#TO REMOVE ACCESS FROM BUYERS AS A SELLER
#remove the following country_flags from the targeted buyer (or all buyers)
#japanese_said_yes
#open_japanese_menu
#and add japanese_said_no flag to the buyer.
#remember to add an event to the buyer so they know where the menu went (to the void)

international_arms_market_category = {

#diverted_production


    dev_remove_access_test = {
        available = {
        }
        visible = {
            is_debug = yes
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            set_country_flag = japanese_said_no 
            clr_country_flag = japanese_said_yes 
            clr_country_flag = open_japanese_menu 

            set_country_flag = italy_said_no 
            clr_country_flag = italy_said_yes 
            clr_country_flag = open_italy_menu 

            set_country_flag = french_said_no 
            clr_country_flag = french_said_yes 
            clr_country_flag = open_french_menu 
        }
    }

    dev_add_access_test = {
        available = {
        }
        visible = {
            is_debug = yes
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            clr_country_flag = japanese_said_no
            set_country_flag = japanese_said_yes 
            set_country_flag = open_japanese_menu 

            clr_country_flag = italy_said_no
            set_country_flag = italy_said_yes 
            set_country_flag = open_italy_menu 

            clr_country_flag = french_said_no
            set_country_flag = french_said_yes 
            set_country_flag = open_french_menu 
        }
    }

    dev_ideas_test = {
        available = {
        }
        visible = {
            is_debug = yes
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            #add_ideas = diverted_production
            #add_ideas = diverted_production_navy
        }
    }

    dev_remove_ideas_test = {
        available = {
        }
        visible = {
            is_debug = yes
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            #remove_ideas = diverted_production
            #remove_ideas = diverted_production_navy
        }
    }

    turn_off_ai_usage = {
        available = {
        }
       visible = {
        NOT = { has_global_flag = no_ai_purchase }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            set_global_flag = no_ai_purchase 
        }
    }
    turn_on_ai_usage = {
        available = {
        }
        visible = {
            has_global_flag = no_ai_purchase
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            clr_global_flag = no_ai_purchase 
        }
    }
    ENG_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = ENG
            any_country = { 
                has_country_flag = england_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
                IF = {
                    limit = {
                        any_country = { 
                            has_country_flag = england_said_yes
                        }
                    }
                    every_country = { 
                        clr_country_flag = england_said_yes 
                        clr_country_flag = open_england_menu 
                    }
                }
            }
        }
    }

    FRA_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = FRA
            any_country = { 
                has_country_flag = france_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = france_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = france_said_yes 
                    clr_country_flag = open_french_menu 
                }
            }
            }
        }
    }

    ITA_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = ITA
            any_country = { 
                has_country_flag = italy_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = italy_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = italy_said_yes 
                    clr_country_flag = open_italy_menu 
                }
            }
            }
        }
    }

    BLE_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = BLE
            any_country = { 
                has_country_flag = belgium_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = belgium_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = belgium_said_yes 
                    clr_country_flag = open_FN_menu 
                }
            }
            }
        }
    }

    HOL_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = HOL
            any_country = { 
                has_country_flag = dutch_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = dutch_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = dutch_said_yes 
                    clr_country_flag = open_dutch_menu 
                }
            }
            }
        }
    }

    POL_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = POL
            any_country = { 
                has_country_flag = polish_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = polish_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = polish_said_yes 
                    clr_country_flag = open_polish_menu 
                }
            }
            }
        }
    }

    GER_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = GER
            any_country = { 
                has_country_flag = germany_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = germany_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = germany_said_yes 
                    clr_country_flag = open_german_menu 
                }
            }
            }
        }
    }

    CZE_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = CZE
            any_country = { 
                has_country_flag = czech_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = czech_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = czech_said_yes 
                    clr_country_flag = open_czech_menu 
                }
            }
            }
        }
    }

    JAP_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = JAP
            any_country = { 
                has_country_flag = japan_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = japan_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = japan_said_yes 
                    clr_country_flag = open_japan_menu 
                }
            }
            }
        }
    }

    SOV_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = SOV
            any_country = { 
                has_country_flag = soviet_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = soviet_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = soviet_said_yes 
                    clr_country_flag = open_soviet_menu 
                }
            }
            }
        }
    }

    USA_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = USA
            any_country = { 
                has_country_flag = america_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = america_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = america_said_yes 
                    clr_country_flag = open_american_menu 
                }
            }
            }
        }
    }

    SWE_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = SWE
            any_country = { 
                has_country_flag = sweden_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = sweden_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = swedeb_said_yes 
                    clr_country_flag = open_sweden_menu 
                }
            }
            }
        }
    }

    HUN_remove_access_to_all_sellers = {
        name = remove_access_to_all_sellers
        available = {   
        }
        visible = {
            tag = HUN
            any_country = { 
                has_country_flag = hungary_said_yes
            }
        }
        icon = category_generic
        cost = 0
        complete_effect = {
            custom_effect_tooltip = remove_access_to_all_sellers_ttp
            hidden_effect = {
            IF = {
                limit = {
                    any_country = { 
                        has_country_flag = hungary_said_yes
                    }
                }
                every_country = { 
                    clr_country_flag = hungary_said_yes 
                    clr_country_flag = open_hungary_menu 
                }
            }
            }
        }
    }


#            OR = { 
#                tag = ENG
#                tag = ITA
#                tag = FRA
#                tag = POL
#                tag = HOL
#                tag = BEL
#                tag = GER
#                tag = CZE
#                tag = JAP
#                tag = SOV
#                tag = USA
#                tag = SWE
#                tag = HUN
#            }
                    #####   ##    #    ####
                    #       # #   #   #
                    #####   #  #  #   #  ###
                    #       #   # #   #    #
                    #####   #    ##    ####

    request_permission_to_purchase_arms_from_English_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = ENG }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }

        #is_enemy_ideology = yes
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = england_said_yes }
            #NOT = { has_country_flag = england_said_no }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            ENG = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_england_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_england_menu }
            has_country_flag = england_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_england_menu 
        }
    }
    close_england_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_england_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_england_menu 
        }
    }

    purchase_English_trains = {
        available = {
            convoy_threat < 0.5
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                #NOT = { has_decision = exporting_trains }
                has_opinion = {
                    target = ROOT
                    value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_trains }
                #ENG = { set_country_flag = exporting_trains }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                ##add_offsite_building = {
                ##    type = industrial_complex
                ##    level = 1
                ##}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                ##add_offsite_building = {
                ##    type = industrial_complex
                ##    level = -1
                ##}
            }
        }
    }
    exporting_trains = {
        days_remove = 45
        visible = {
            has_country_flag = exporting_trains
        }
        icon = generic_trucks

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_trains
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }   

    purchase_English_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                #NOT = { has_decision = exporting_rifles }
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_rifles }
                #ENG = { set_country_flag = exporting_rifles }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_rifles = {
        days_remove = 90
        visible = {
            has_country_flag = exporting_rifles
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_rifles
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

    purchase_English_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                #NOT = { has_decision = exporting_support_equipment }
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_support_equipment }
                #ENG = { set_country_flag = exporting_support_equipment }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_support_equipment = {
        days_remove = 45
        visible = {
            has_country_flag = exporting_support_equipment
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_support_equipment
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

    purchase_English_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                #NOT = { has_decision = exporting_trucks }
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_trucks }
                #ENG = { set_country_flag = exporting_trucks }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_trucks = {
        days_remove = 45
        visible = {
            has_country_flag = exporting_trucks
        }
        icon = generic_trucks

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_trucks
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }   

    purchase_English_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                #NOT = { has_decision = exporting_armored_cars }
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ENG = { has_tech = armored_car1 }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_armored_cars }
                #ENG = { set_country_flag = exporting_armored_cars }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = { #
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_armored_cars = {
        days_remove = 90
        visible = {
            has_country_flag = exporting_armored_cars
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_armored_cars
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

    purchase_English_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                #NOT = { has_decision = exporting_mechanized }
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ENG = { has_tech = mechanised_infantry }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_mechanized }
                #ENG = { set_country_flag = exporting_mechanized }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_mechanized = {
        days_remove = 90
        visible = {
            has_country_flag = exporting_mechanized
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_mechanized
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

    purchase_English_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_artillery }
                #ENG = { set_country_flag = exporting_artillery }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_artillery = {
        days_remove = 90
        visible = {
            has_country_flag = exporting_artillery
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_artillery
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_English_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ENG = { has_tech = interwar_antitank }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_anti-tank_guns }
                #ENG = { set_country_flag = exporting_anti-tank_guns }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_anti-tank_guns = {
        days_remove = 90
        visible = {
            has_country_flag = exporting_anti-tank_guns
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_anti-tank_guns
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_English_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ENG = { has_tech = interwar_antiair }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_anti-air_guns }
                #ENG = { set_country_flag = exporting_anti-air_guns }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = ENG
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_anti-air_guns = {
        days_remove = 90
        visible = {
            has_country_flag = exporting_anti-air_guns
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_anti-air_guns
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
#English Tanks
    purchase_English_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 100
        visible = {
            ENG = { 
                OR = {
                    has_tech = basic_light_tank
                    has_tech = gwtank_chassis
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_old_light_tanks }
                #ENG = { set_country_flag = exporting_old_light_tanks }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 30
                    producer = ENG
                    variant_name = "Vickers 6 ton B"
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 30
                    producer = ENG
                    variant_name = "Vickers 6 ton A"
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    exporting_old_light_tanks = {
        days_remove = 100
        visible = {
            has_country_flag = exporting_old_light_tanks
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_old_light_tanks
            effect_tooltip = {
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }


    purchase_English_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = basic_light_tank
                    has_tech = gwtank_chassis
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_light_tanks }
                #ENG = { set_country_flag = exporting_light_tanks }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_light_tanks = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_light_tanks
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_light_tanks
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_English_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = gwtank_chassis
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_medium_tanks }
                #ENG = { set_country_flag = exporting_medium_tanks }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    exporting_medium_tanks = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_medium_tanks
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_medium_tanks
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_English_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_amphibious_tanks }
                #ENG = { set_country_flag = exporting_amphibious_tanks }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    exporting_amphibious_tanks = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_amphibious_tanks
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_amphibious_tanks
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_English_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_heavy_tanks }
                #ENG = { set_country_flag = exporting_heavy_tanks }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    exporting_heavy_tanks = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_heavy_tanks
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_heavy_tanks
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    purchase_English_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_modern_tanks }
                #ENG = { set_country_flag = exporting_modern_tanks }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    exporting_modern_tanks = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_modern_tanks
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_modern_tanks
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_English_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_fighters }
                #ENG = { set_country_flag = exporting_fighters }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = ENG
                }
            }
            else = {
                IF = { limit = { ENG = { NOT = { has_tech = improved_small_airframe } } }
                    add_equipment_to_stockpile = { 
                        type = small_plane_airframe_0
                        amount = 20
                        producer = ENG
                    }
                }
                else = {
                    add_equipment_to_stockpile = { 
                        type = small_plane_airframe
                        amount = 20
                        producer = ENG
                    }
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_fighters = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_fighters
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_fighters
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_English_carrier_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = cv_early_fighter
                    has_tech = iw_small_airframe
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_carrier_fighters }
                #ENG = { set_country_flag = exporting_carrier_fighters }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_fighter_equipment_0
                    amount = 20
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_airframe
                    amount = 20
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_carrier_fighters = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_carrier_fighters
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_carrier_fighters
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_English_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_cas }
                #ENG = { set_country_flag = exporting_cas }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_cas = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_cas
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_cas
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_English_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_naval_bombers }
                #ENG = { set_country_flag = exporting_naval_bombers }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = nav_bomber_equipment_1
                    amount = 15
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_naval_bomber_airframe
                    amount = 15
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_naval_bombers = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_naval_bombers
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_naval_bombers
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_English_carrier_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = cv_naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_carrier_naval_bombers }
                #ENG = { set_country_flag = exporting_carrier_naval_bombers }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_nav_bomber_equipment_1
                    amount = 15
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_naval_bomber_airframe
                    amount = 15
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_carrier_naval_bombers = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_carrier_naval_bombers
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_carrier_naval_bombers
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_English_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_bombers }
                #ENG = { set_country_flag = exporting_bombers }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe
                    amount = 15
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_bombers = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_bombers
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_bombers
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_English_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { ENG = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 2
            ENG = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ENG = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = basic_large_airframe #ENG has IW frame but no design.
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_heavy_bombers }
                #ENG = { set_country_flag = exporting_heavy_bombers }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = ENG
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = ENG
                }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    exporting_heavy_bombers = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_heavy_bombers
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_heavy_bombers
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_English_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ENG = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                ENG = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            ENG = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_submarines }
                #ENG = { set_country_flag = exporting_submarines }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.05 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
            ENG = { 
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.05 }
            }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_ship_hull_submarine }
                    }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "English Submarine Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_ship_hull_submarine }
                    }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "English Submarine Purchase" creator = ENG }
                }
                else = {
                    ENG = {
                        create_equipment_variant = {
                            name = "English Submarine Purchase"               
                            type = ship_hull_submarine_2
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_2
                                rear_1_custom_slot = ship_torpedo_sub_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "English Submarine Purchase" creator = ENG }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_submarine }
                    }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_4 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_4 equipment_variant = "English Submarine Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_submarine }
                    }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_3 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_3 equipment_variant = "English Submarine Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = basic_submarine }
                    }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_2 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_2 equipment_variant = "English Submarine Purchase" creator = ENG }
                }
                else = {
                    ENG = {
                        create_equipment_variant = {
                            name = "English Submarine Purchase"
                            type = submarine_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 1
                                sub_engine_upgrade = 0
                            }
                        }
                    }
                    create_ship = { type = submarine_1 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_1 equipment_variant = "English Submarine Purchase" creator = ENG }
                    create_ship = { type = submarine_1 equipment_variant = "English Submarine Purchase" creator = ENG }
                }
            }
            ENG = {
                add_political_power = 30
            }

            ENG = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_submarines = {
        days_remove = 150
        visible = {
            has_country_flag = exporting_submarines
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_submarines
            effect_tooltip = {
                #remove_ideas = diverted_production_navy
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_English_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ENG = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                ENG = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_submarines }
                #ENG = { set_country_flag = exporting_submarines }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
        ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
        }
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "English Destroyer Purchase" creator = ENG }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "English Destroyer Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "English Destroyer Purchase" creator = ENG }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "English Destroyer Purchase" creator = ENG }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    #ENG = {
                    #    create_equipment_variant = {
                    #        name = "E/F/G/H Class"    
                    #        type = ship_hull_light_2
                    #        name_group = ROOT_DD_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_battery_1
                    #            fixed_ship_anti_air_slot = ship_anti_air_1
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = light_ship_engine_2
                    #            fixed_ship_torpedo_slot = ship_torpedo_1
                    #            mid_1_custom_slot = ship_mine_layer_1
                    #            rear_1_custom_slot = ship_depth_charge_1
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_light_2 equipment_variant = "E/F/G/H Class" creator = ENG }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "E/F/G/H Class" creator = ENG }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "English Destroyer Purchase" creator = ENG }
                    create_ship = { type = destroyer_4 equipment_variant = "English Destroyer Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "English Destroyer Purchase" creator = ENG }
                    create_ship = { type = destroyer_3 equipment_variant = "English Destroyer Purchase" creator = ENG }
                }
                else_if = {
                    limit = {
                        ENG = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "English Destroyer Purchase" creator = ENG }
                    create_ship = { type = destroyer_2 equipment_variant = "English Destroyer Purchase" creator = ENG }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "English Destroyer Purchase" creator = ENG }
                    create_ship = { type = destroyer_1 equipment_variant = "English Destroyer Purchase" creator = ENG }
                }
            }
            ENG = {
                add_political_power = 30
            }

            ENG = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    exporting_destroyers = {
        days_remove = 150
        visible = {
            has_country_flag = exporting_destroyers
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_destroyers
            effect_tooltip = {
                #remove_ideas = diverted_production_navy
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_an_English_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ENG = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2
                ENG = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_a_cruiser }
                #ENG = { set_country_flag = exporting_a_cruiser }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.05 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "English Cruiser Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "English Cruiser Purchase" creator = ENG }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #ENG = {
                    #    create_equipment_variant = {
                    #         name = "English Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "Leander Class" creator = ENG }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "English Cruiser Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "English Cruiser Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "English Cruiser Purchase" creator = ENG }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "English Cruiser Purchase" creator = ENG }
                }
            }
            ENG = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.05 }
            }

            ENG = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    exporting_a_cruiser = {
        days_remove = 20
        visible = {
            has_country_flag = exporting_a_cruiser
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_a_cruiser
            effect_tooltip = {
                #remove_ideas = diverted_production_navy
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }    

    purchase_an_english_heavy_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ENG
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ENG = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ENG = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ENG = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3
                ENG = {
                    has_opinion = {
                        target = ROOT
                        value > 49
                    }
                }
        }
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 360
        visible = {
            ENG = { NOT = { has_capitulated = yes }}
            has_country_flag = open_england_menu #open_england_menu
            NOT = { 
                tag = ENG
            }
            ENG = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ENG
            }
            country_exists = ENG
        }
        icon = generic_naval
        cost = 25
        complete_effect = {
            hidden_effect = {
                #ENG = { activate_decision = exporting_a_heavy_cruiser }
                #ENG = { set_country_flag = exporting_a_heavy_cruiser }
            }
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.05 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ENG
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            ENG = {
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.05 }                
            }
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Heavy Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_3
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_4
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_3
                                mid_1_custom_slot = ship_torpedo_2
                                mid_2_custom_slot = ship_airplane_launcher_2
                                rear_1_custom_slot = ship_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "English Heavy Cruiser Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Heavy Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_2
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_2
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "English Heavy Cruiser Purchase" creator = ENG }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #ENG = {
                    #    create_equipment_variant = {
                    #         name = "English Heavy Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_1 equipment_variant = "York Class" creator = ENG }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        ENG = { has_tech = advanced_heavy_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Heavy Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_4 equipment_variant = "English Heavy Cruiser Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = improved_heavy_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Heavy Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_3 equipment_variant = "English Heavy Cruiser Purchase" creator = ENG }
                }
                else_if = { 
                    limit = {
                        ENG = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Heavy Cruiser Purchase"
                            type = heavy_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_2 equipment_variant = "English Heavy Cruiser Purchase" creator = ENG }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    ENG = {
                        create_equipment_variant = {
                            name = "English Heavy Cruiser Purchase"
                            type = heavy_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_1 equipment_variant = "English Heavy Cruiser Purchase" creator = ENG }
                }
            }
            ENG = {
                add_political_power = 25
            }

            ENG = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }

    exporting_a_heavy_cruiser = {
        days_remove = 20
        visible = {
            has_country_flag = exporting_a_heavy_cruiser
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_a_heavy_cruiser
            effect_tooltip = {
                #remove_ideas = diverted_production_navy
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    } 
#                   ##  ##########    #
#                   ##      ##       # #
#                   ##      ##      #   #
#                   ##      ##     #######
#                   ##      ##    #       #
#                   ##      ##   #         #
#                   ##      ##  #           #
    request_permission_to_purchase_arms_from_italy_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = ITA }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = italy_said_yes }
            #NOT = { has_country_flag = italy_said_no }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            ITA = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_italy_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_italy_menu }
            has_country_flag = italy_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_italy_menu 
        }
    }
    close_italy_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_italy_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_italy_menu 
        }
    }

    purchase_italy_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_trains }
                #ITA = { set_country_flag = exporting_trains }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_italy_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_rifles }
                #ITA = { set_country_flag = exporting_rifles }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_italy_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_support_equipment }
                #ITA = { set_country_flag = exporting_support_equipment }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_italy_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_trucks }
                #ITA = { set_country_flag = exporting_trucks }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_italy_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ITA = { has_tech = armored_car1 }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_armored_cars }
                #ITA = { set_country_flag = exporting_armored_cars }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = ITA
            }
            ITA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_italy_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ITA = { has_tech = mechanised_infantry }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_mechanized }
                #ITA = { set_country_flag = exporting_mechanized }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = ITA
            }
            ITA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_italy_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_artillery }
                #ITA = { set_country_flag = exporting_artillery }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = ITA
            }
            ITA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_italy_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ITA = { has_tech = interwar_antitank }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_anti-tank_guns }
                #ITA = { set_country_flag = exporting_anti-tank_guns }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = ITA
            }
            ITA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_italy_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            ITA = { has_tech = interwar_antiair }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_anti-air_guns }
                #ITA = { set_country_flag = exporting_anti-air_guns }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = ITA
            }
            ITA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#italy Tanks

    purchase_italy_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 100
        visible = {
            #ITA = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_old_light_tanks }
                #ITA = { set_country_flag = exporting_old_light_tanks }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 30
                    producer = ITA
                    variant_name = "Fiat 3000B"
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 30
                    producer = ITA
                    variant_name = "Fiat 3000"
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

    purchase_italy_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #ITA = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_light_tanks }
                #ITA = { set_country_flag = exporting_light_tanks }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = ITA
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }


    purchase_italy_light_td = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 100
        visible = {
            ITA = { 
                has_tech = basic_light_tank_chassis
                has_completed_focus = ITA_italian_tankettes
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_light_td }
                #ITA = { set_country_flag = exporting_light_td }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = { 
                type = light_tank_destroyer_chassis
                amount = 50
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_light_td = {
        days_remove = 100
        visible = {
            has_country_flag = exporting_light_td
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_light_td
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #exporting_light_td

    purchase_italy_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = basic_medium_tank_chassis
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_medium_tanks }
                #ITA = { set_country_flag = exporting_medium_tanks }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = ITA
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_italy_medium_td = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ITA = { 
                has_dlc = "No Step Back"
                has_tech = advanced_medium_tank_chassis
                has_completed_focus = ITA_ferrea_mole_ferreo_cuore
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_medium_td }
                #ITA = { set_country_flag = exporting_medium_td }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = { 
                type = medium_tank_destroyer_chassis
                amount = 50
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    exporting_medium_td = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_medium_td
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_medium_td
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_italy_medium_spg = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ITA = { 
                has_dlc = "No Step Back"
                has_tech = advanced_medium_tank_chassis
                has_completed_focus = ITA_ferrea_mole_ferreo_cuore
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_medium_spg }
                #ITA = { set_country_flag = exporting_medium_spg }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = { 
                type = medium_tank_artillery_chassis
                amount = 50
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    exporting_medium_spg = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_medium_spg
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_medium_td
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_italy_medium_spaa = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 100
        visible = {
            ITA = { 
                has_dlc = "No Step Back"
                has_tech = improved_medium_tank_chassis
                OR = { 
                    has_completed_focus = ITA_end_fiat_ansaldo_duopoly
                    has_completed_focus = ITA_modernize_ansaldo_facilities
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_medium_spaa }
                #ITA = { set_country_flag = exporting_medium_spaa }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = { 
                type = medium_tank_aa_chassis
                amount = 36
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    exporting_medium_spaa = {
        days_remove = 100
        visible = {
            has_country_flag = exporting_medium_spaa
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_medium_spaa
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }



    purchase_italy_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_amphibious_tanks }
                #ITA = { set_country_flag = exporting_amphibious_tanks }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = ITA
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_italy_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_heavy_tanks }
                #ITA = { set_country_flag = exporting_heavy_tanks }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = ITA
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_italy_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_modern_tanks }
                #ITA = { set_country_flag = exporting_modern_tanks }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = ITA
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_italy_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_fighters }
                #ITA = { set_country_flag = exporting_fighters }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = ITA
                }
            }
            else = {
                IF = { limit = { ITA = { NOT = { has_tech = improved_small_airframe } } }
                    add_equipment_to_stockpile = { 
                        type = small_plane_airframe_0
                        amount = 20
                        producer = ITA
                    }
                }
                else = {
                    add_equipment_to_stockpile = { 
                        type = small_plane_airframe
                        amount = 20
                        producer = ITA
                    }
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }


    purchase_italy_heavy_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            has_dlc = "By Blood Alone"
            ITA = { 
                has_tech = basic_medium_airframe
                has_completed_focus = ITA_citta_dell_aria
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_heavy_fighters }
                #ITA = { set_country_flag = exporting_heavy_fighters }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = { 
                type = medium_plane_fighter_airframe
                amount = 15
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    exporting_heavy_fighters = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_heavy_fighters
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_heavy_fighters
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_italy_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_cas }
                #ITA = { set_country_flag = exporting_cas }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = ITA
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_cas = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_cas
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 20
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -2
#                #}
#            }
#        }
#    }

    purchase_italy_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = naval_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_naval_bombers }
                #ITA = { set_country_flag = exporting_naval_bombers }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = nav_bomber_equipment_1
                    amount = 15
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = {  #has to just be the basic one because of BBA.
                    type = medium_plane_airframe_1
                    amount = 15
                    producer = ITA
                    variant_name = "SM.79"
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_naval_bombers = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_naval_bombers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 20
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -2
#                #}
#            }
#        }
#    }

    purchase_italy_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_bombers }
                #ITA = { set_country_flag = exporting_bombers }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = ITA
                }
            }
            else = {
                IF = {
                    Limit = { ITA = { has_tech = improved_medium_airframe }}
                    add_equipment_to_stockpile = { 
                        type = medium_plane_airframe
                        amount = 15
                        producer = ITA
                    }
                }
                else = {
                    add_equipment_to_stockpile = { 
                        type = medium_plane_airframe_1
                        amount = 15
                        producer = ITA
                        variant_name = "SM.81"
                    }
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_bombers = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_bombers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 20
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -2
#                #}
#            }
#        }
#    }

    purchase_italy_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            ITA = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_heavy_bombers }
                #ITA = { set_country_flag = exporting_heavy_bombers }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = ITA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = ITA
                }
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_italy_maritime_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { ITA = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            ITA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            has_dlc = "By Blood Alone"
            ITA = { 
                has_tech = improved_large_airframe
                has_completed_focus = ITA_long_range_aircraft
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_maritime_bombers }
                #ITA = { set_country_flag = exporting_maritime_bombers }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = { 
                type = large_plane_maritime_patrol_plane_airframe
                amount = 15
                producer = ITA
            }
            ITA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    exporting_maritime_bombers = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_maritime_bombers
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_maritime_bombers
           effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_italy_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ITA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1 
                ITA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            ITA = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_submarines }
                #ITA = { set_country_flag = exporting_submarines }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        ITA = { has_tech = advanced_ship_hull_submarine }
                    }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "italy Submarine Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = improved_ship_hull_submarine }
                    }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "italy Submarine Purchase" creator = ITA }
                }
                else = {
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Calvi Class" creator = ITA }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Calvi Class" creator = ITA }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Calvi Class" creator = ITA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        ITA = { has_tech = advanced_submarine }
                    }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_4 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_4 equipment_variant = "italy Submarine Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = improved_submarine }
                    }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_3 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_3 equipment_variant = "italy Submarine Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = basic_submarine }
                    }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_2 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_2 equipment_variant = "italy Submarine Purchase" creator = ITA }
                }
                else = {
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Submarine Purchase"
                            type = submarine_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 1
                                sub_engine_upgrade = 0
                            }
                        }
                    }
                    create_ship = { type = submarine_1 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_1 equipment_variant = "italy Submarine Purchase" creator = ITA }
                    create_ship = { type = submarine_1 equipment_variant = "italy Submarine Purchase" creator = ITA }
                }
            }
            ITA = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            ITA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_italy_cruiser_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ITA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                ITA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            has_dlc = "Man the Guns"
            ITA = { 
                has_tech = cruiser_submarines
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_cruiser_submarines }
                #ITA = { set_country_flag = exporting_cruiser_submarines }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 200 }
                create_ship = { type = ship_hull_cruiser_submarine equipment_variant = "Cagni Class" creator = ITA }
            ITA = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            ITA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_italy_midget_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ITA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2
                ITA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 110
        visible = {
            has_dlc = "Man the Guns"
            ITA = { 
                has_tech = midget_submarines
            }
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_midget_submarines }
                #ITA = { set_country_flag = exporting_midget_submarines }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 100 }
                create_ship = { type = ship_hull_midget_submarine equipment_variant = "CB Class" creator = ITA }
                create_ship = { type = ship_hull_midget_submarine equipment_variant = "CB Class" creator = ITA }
                create_ship = { type = ship_hull_midget_submarine equipment_variant = "CB Class" creator = ITA }
            ITA = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.05 }
            }

            ITA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    exporting_midget_submarines = {
        days_remove = 150
        visible = {
            has_country_flag = exporting_midget_submarines
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_midget_submarines
            effect_tooltip = {
                #remove_ideas = diverted_production_navy
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_italy_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ITA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                ITA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_submarines }
                #ITA = { set_country_flag = exporting_submarines }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        ITA = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    ITA = {
                        create_equipment_variant = {
                            name = "Centauro Class"    
                            type = ship_hull_light_2
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_2
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Centauro Class" creator = ITA }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Centauro Class" creator = ITA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        ITA = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                    create_ship = { type = destroyer_4 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                    create_ship = { type = destroyer_3 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                }
                else_if = {
                    limit = {
                        ITA = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                    create_ship = { type = destroyer_2 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                    create_ship = { type = destroyer_1 equipment_variant = "italy Destroyer Purchase" creator = ITA }
                }
            }
            ITA = {
                add_political_power = 30
            }

            ITA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_destroyers = {
#        days_remove = 150
#        visible = {
#            has_country_flag = exporting_destroyers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production_navy
#                add_political_power = 30
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -3
#                #}
#            }
#        }
#    }

    purchase_an_italy_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = ITA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { ITA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            ITA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { ITA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2
                ITA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            ITA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_italy_menu
            NOT = { 
                tag = ITA
            }
            ITA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = ITA
            }
            country_exists = ITA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #ITA = { activate_decision = exporting_a_cruiser }
                #ITA = { set_country_flag = exporting_a_cruiser }
            }
            ITA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = ITA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        ITA = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "italy Cruiser Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "italy Cruiser Purchase" creator = ITA }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #ITA = {
                    #    create_equipment_variant = {
                    #         name = "italy Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "Duca delgi Abruzzi Class" creator = ITA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        ITA = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "italy Cruiser Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "italy Cruiser Purchase" creator = ITA }
                }
                else_if = { 
                    limit = {
                        ITA = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "italy Cruiser Purchase" creator = ITA }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    ITA = {
                        create_equipment_variant = {
                            name = "italy Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "italy Cruiser Purchase" creator = ITA }
                }
            }
            ITA = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            ITA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#    exporting_a_cruiser = {
#        days_remove = 20
#        visible = {
#            has_country_flag = exporting_a_cruiser
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production_navy
#                add_political_power = 30
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -3
#                #}
#            }
#        }
#    }

#########   #####
##          ##  #
#######     #####
##          ##  #
##          ##   #
##          ##    #
##          ##    # Ance

#France

    request_permission_to_purchase_arms_from_french_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = FRA }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = french_said_yes }
            #NOT = { has_country_flag = french_said_no }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            FRA = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_french_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_french_menu }
            has_country_flag = french_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_french_menu 
        }
    }
    close_french_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_french_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_french_menu 
        }
    }

    purchase_french_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_trains }
                #FRA = { set_country_flag = exporting_trains }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = FRA
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_rifles }
                #FRA = { set_country_flag = exporting_rifles }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = FRA
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_support_equipment }
                #FRA = { set_country_flag = exporting_support_equipment }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = FRA
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_trucks }
                #FRA = { set_country_flag = exporting_trucks }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = FRA
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            FRA = { has_tech = armored_car1 }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_armored_cars }
                #FRA = { set_country_flag = exporting_armored_cars }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = FRA
            }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            FRA = { has_tech = mechanised_infantry }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_mechanized }
                #FRA = { set_country_flag = exporting_mechanized }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = FRA
            }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_artillery }
                #FRA = { set_country_flag = exporting_artillery }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = FRA
            }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_french_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            FRA = { has_tech = interwar_antitank }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_anti-tank_guns }
                #FRA = { set_country_flag = exporting_anti-tank_guns }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = FRA
            }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_french_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            FRA = { has_tech = interwar_antiair }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_anti-air_guns }
                #FRA = { set_country_flag = exporting_anti-air_guns }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = FRA
            }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#french Tanks
    purchase_french_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 100
        visible = {
            #FRA = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_old_light_tanks }
                #FRA = { set_country_flag = exporting_old_light_tanks }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = FRA
                }
            }
            else = {
                 add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 30
                    producer = FRA
                    variant_name = "FT Char Cannon"
                }
                 add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 30
                    producer = FRA
                    variant_name = "FT mod. 31"
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }


    purchase_french_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #FRA = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_light_tanks }
                #FRA = { set_country_flag = exporting_light_tanks }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = FRA
                }
            }
            else = {
                IF = {
                    Limit = { FRA = { has_tech = advanced_light_tank_chassis } }
                    add_equipment_to_stockpile = { 
                        type = light_tank_chassis
                        amount = 60
                        producer = FRA
                    }
                }
                else = {
                    add_equipment_to_stockpile = { 
                        type = light_tank_chassis_1
                        amount = 60
                        producer = FRA
                    }
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_french_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 2
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = gwtank_chassis
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_medium_tanks }
                #FRA = { set_country_flag = exporting_medium_tanks }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_amphibious_tanks }
                #FRA = { set_country_flag = exporting_amphibious_tanks }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_french_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_heavy_tanks }
                #FRA = { set_country_flag = exporting_heavy_tanks }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = FRA
                }
            }
            else = {
                IF = { 
                    Limit = { FRA = { has_tech = improved_heavy_tank_chassis } }
                    add_equipment_to_stockpile = { 
                        type = heavy_tank_chassis
                        amount = 50
                        producer = FRA
                    }
                }
                else = {
                    add_equipment_to_stockpile = { 
                        type = heavy_tank_chassis_0
                        amount = 50
                        producer = FRA
                    }
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_french_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_modern_tanks }
                #FRA = { set_country_flag = exporting_modern_tanks }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_french_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_fighters }
                #FRA = { set_country_flag = exporting_fighters }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_fighters = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_fighters
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 20
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -2
#                #}
#            }
#        }
#    }

    purchase_french_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_cas }
                #FRA = { set_country_flag = exporting_cas }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_cas = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_cas
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 20
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -2
#                #}
#            }
#        }
#    }

    purchase_french_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_naval_bombers }
                #FRA = { set_country_flag = exporting_naval_bombers }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = nav_bomber_equipment_1
                    amount = 15
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_naval_bomber_airframe
                    amount = 15
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_naval_bombers = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_naval_bombers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 20
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -2
#                #}
#            }
#        }
#    }

    purchase_french_carrier_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = cv_naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_carrier_naval_bombers }
                #FRA = { set_country_flag = exporting_carrier_naval_bombers }
            }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_nav_bomber_equipment_1
                    amount = 15
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_naval_bomber_airframe
                    amount = 15
                    producer = FRA
                }
            }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_french_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_bombers }
                #FRA = { set_country_flag = exporting_bombers }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe
                    amount = 15
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_bombers = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_bombers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 20
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -2
#                #}
#            }
#        }
#    }

    purchase_french_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { FRA = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 2
            FRA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            FRA = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_heavy_bombers }
                #FRA = { set_country_flag = exporting_heavy_bombers }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = FRA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = FRA
                }
            }
            FRA = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#    exporting_heavy_bombers = {
#        days_remove = 120
#        visible = {
#            has_country_flag = exporting_heavy_bombers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production
#                add_political_power = 25
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -3
#                #}
#            }
#        }
#    }
    purchase_french_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { FRA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                FRA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            FRA = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_submarines }
                #FRA = { set_country_flag = exporting_submarines }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        FRA = { has_tech = advanced_ship_hull_submarine }
                    }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "French Submarine Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = improved_ship_hull_submarine }
                    }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "French Submarine Purchase" creator = FRA }
                }
                else = {
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Redoubtable Class" creator = FRA }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Redoubtable Class" creator = FRA }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Redoubtable Class" creator = FRA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        FRA = { has_tech = advanced_submarine }
                    }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_4 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_4 equipment_variant = "French Submarine Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = improved_submarine }
                    }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_3 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_3 equipment_variant = "French Submarine Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = basic_submarine }
                    }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_2 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_2 equipment_variant = "French Submarine Purchase" creator = FRA }
                }
                else = {
                    FRA = {
                        create_equipment_variant = {
                            name = "French Submarine Purchase"
                            type = submarine_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 1
                                sub_engine_upgrade = 0
                            }
                        }
                    }
                    create_ship = { type = submarine_1 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_1 equipment_variant = "French Submarine Purchase" creator = FRA }
                    create_ship = { type = submarine_1 equipment_variant = "French Submarine Purchase" creator = FRA }
                }
            }
            FRA = {
                add_political_power = 30
            }

            FRA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_french_cruiser_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { FRA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                FRA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            has_dlc = "Man the Guns"
            FRA = { 
                has_tech = cruiser_submarines
            }
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_cruiser_submarines }
                #FRA = { set_country_flag = exporting_cruiser_submarines }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 200 }
                create_ship = { type = ship_hull_cruiser_submarine equipment_variant = "Surcouf Class" creator = FRA }
            FRA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
                add_political_power = 30
            }
            FRA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    exporting_cruiser_submarines = {
        days_remove = 150
        visible = {
            has_country_flag = exporting_cruiser_submarines
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            effect_tooltip = {
                #remove_ideas = diverted_production_navy
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_french_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { FRA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1 
                FRA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_submarines }
                #FRA = { set_country_flag = exporting_submarines }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        FRA = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "french Destroyer Purchase" creator = FRA }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "french Destroyer Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "french Destroyer Purchase" creator = FRA }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "french Destroyer Purchase" creator = FRA }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    #FRA = {
                    #    create_equipment_variant = {
                    #        name = "Centauro Class"    
                    #        type = ship_hull_light_2
                    #        name_group = ROOT_DD_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = light_ship_engine_2
                    #            fixed_ship_torpedo_slot = ship_torpedo_1
                    #            mid_1_custom_slot = ship_mine_layer_1
                    #            rear_1_custom_slot = ship_depth_charge_1
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Mogador Class" creator = FRA }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Mogador Class" creator = FRA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        FRA = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "french Destroyer Purchase" creator = FRA }
                    create_ship = { type = destroyer_4 equipment_variant = "french Destroyer Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "french Destroyer Purchase" creator = FRA }
                    create_ship = { type = destroyer_3 equipment_variant = "french Destroyer Purchase" creator = FRA }
                }
                else_if = {
                    limit = {
                        FRA = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "french Destroyer Purchase" creator = FRA }
                    create_ship = { type = destroyer_2 equipment_variant = "french Destroyer Purchase" creator = FRA }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "french Destroyer Purchase" creator = FRA }
                    create_ship = { type = destroyer_1 equipment_variant = "french Destroyer Purchase" creator = FRA }
                }
            }
            FRA = {
                add_political_power = 30
            }

            FRA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#    exporting_destroyers = {
#        days_remove = 150
#        visible = {
#            has_country_flag = exporting_destroyers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production_navy
#                add_political_power = 30
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -3
#                #}
#            }
#        }
#    }

    purchase_an_french_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = FRA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { FRA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            FRA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { FRA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2 
                FRA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            FRA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = FRA
            }
            FRA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = FRA
            }
            country_exists = FRA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #FRA = { activate_decision = exporting_a_cruiser }
                #FRA = { set_country_flag = exporting_a_cruiser }
            }
            FRA = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = FRA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        FRA = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "french Cruiser Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    FRA = {
                        create_equipment_variant = {
                            name = "french Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "french Cruiser Purchase" creator = FRA }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    FRA = {
                        create_equipment_variant = {
                            name = "Toulon Class"    
                            type = ship_hull_cruiser_2
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "Toulon Class" creator = FRA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        FRA = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "French Cruiser Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "French Cruiser Purchase" creator = FRA }
                }
                else_if = { 
                    limit = {
                        FRA = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "French Cruiser Purchase" creator = FRA }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    FRA = {
                        create_equipment_variant = {
                            name = "French Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "French Cruiser Purchase" creator = FRA }
                }
            }
            FRA = {
                add_political_power = 30
            }

            FRA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#


################################################################################################################ POLANDOOOOO
    request_permission_to_purchase_arms_from_polish_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = POL }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = polish_said_yes }
            #NOT = { has_country_flag = polish_said_no }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            POL = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_polish_menu = { 
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_polish_menu }
            has_country_flag = polish_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_polish_menu 
        }
    }
    close_polish_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_polish_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_polish_menu 
        }
    }

    purchase_polish_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_rifles }
                #POL = { set_country_flag = exporting_rifles }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = POL
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_polish_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_support_equipment }
                #POL = { set_country_flag = exporting_support_equipment }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = POL
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }



    purchase_polish_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 100
        visible = {
            #POL = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_old_light_tanks }
                #POL = { set_country_flag = exporting_old_light_tanks }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 60
                    producer = POL
                    variant_name = "TKS"
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

    purchase_polish_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #POL = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_light_tanks }
                #POL = { set_country_flag = exporting_light_tanks }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = POL
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_polish_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 2
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            POL = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = basic_medium_tank_chassis
                }
            }
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_medium_tanks }
                #POL = { set_country_flag = exporting_medium_tanks }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = POL
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_polish_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            POL = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_amphibious_tanks }
                #POL = { set_country_flag = exporting_amphibious_tanks }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = POL
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_polish_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            POL = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_heavy_tanks }
                #POL = { set_country_flag = exporting_heavy_tanks }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = POL
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_polish_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            POL = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_modern_tanks }
                #POL = { set_country_flag = exporting_modern_tanks }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = POL
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }

    purchase_polish_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            POL = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_fighters }
                #POL = { set_country_flag = exporting_fighters }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = POL
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_polish_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = POL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { POL = { has_idea = closed_economy }}
            POL = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { POL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            POL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            POL = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            POL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_polish_menu
            NOT = { 
                tag = POL
            }
            POL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = POL
            }
            country_exists = POL
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #POL = { activate_decision = exporting_cas }
                #POL = { set_country_flag = exporting_cas }
            }
            POL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = POL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = POL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = POL
                }
            }
            POL = {
                #remove_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
############################################################################################################### DUTCH FUKKERS
    request_permission_to_purchase_arms_from_dutch_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HOL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = HOL }
            NOT = { HOL = { has_idea = closed_economy }}
            HOL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { HOL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = dutch_said_yes }
            #NOT = { has_country_flag = dutch_said_no }
            HOL = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = HOL
            }
            HOL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HOL
            }
            country_exists = HOL
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            HOL = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_dutch_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HOL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_dutch_menu }
            has_country_flag = dutch_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_dutch_menu 
        }
    }
    close_dutch_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HOL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_dutch_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_dutch_menu 
        }
    }


    purchase_dutch_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HOL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HOL = { has_idea = closed_economy }}
            HOL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { HOL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HOL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            HOL = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            HOL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_dutch_menu
            NOT = { 
                tag = HOL
            }
            HOL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HOL
            }
            country_exists = HOL
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HOL = { activate_decision = exporting_cas }
                #HOL = { set_country_flag = exporting_cas }
            }
            HOL = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HOL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HOL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = HOL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = HOL
                }
            }
            HOL = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_dutch_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HOL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HOL = { has_idea = closed_economy }}
            HOL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { HOL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HOL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            HOL = { 
                OR = {
                    has_tech = naval_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            HOL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_dutch_menu
            NOT = { 
                tag = HOL
            }
            HOL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HOL
            }
            country_exists = HOL
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HOL = { activate_decision = exporting_naval_bombers }
                #HOL = { set_country_flag = exporting_naval_bombers }
            }
            HOL = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HOL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HOL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = nav_bomber_equipment_1
                    amount = 15
                    producer = HOL
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe
                    amount = 15
                    producer = HOL
                }
            }
            HOL = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#####   #####   ##
##  #   ##      ##
#####   ####    ##
##  #   ##      ##
#####   #####   ######
#Belgium (FN)
    request_permission_to_purchase_arms_from_FN = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = BEL }
            NOT = { BEL = { has_idea = closed_economy }}
            BEL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { BEL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = belgium_said_yes }
            #NOT = { has_country_flag = belgium_said_no }
            BEL = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = BEL
            }
            BEL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = BEL
            }
            country_exists = BEL
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            BEL = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_FN_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_FN_menu }
            has_country_flag = belgium_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_FN_menu 
        }
    }
    close_FN_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_FN_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_FN_menu 
        }
    }

    purchase_FN_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { BEL = { has_idea = closed_economy }}
            BEL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { BEL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            BEL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            BEL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_FN_menu
            NOT = { 
                tag = BEL
            }
            BEL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = BEL
            }
            country_exists = BEL
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #BEL = { activate_decision = exporting_rifles }
                #BEL = { set_country_flag = exporting_rifles }
            }
            BEL = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = BEL
            }
            BEL = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

    purchase_belgian_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { BEL = { has_idea = closed_economy }}
            BEL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { BEL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            BEL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            BEL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_belgian_menu
            NOT = { 
                tag = BEL
            }
            BEL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = BEL
            }
            country_exists = BEL
        }
        icon = ger_milBELry_buildup

        complete_effect = {
            hidden_effect = {
                #BEL = { activate_decision = exporting_artillery }
                #BEL = { set_country_flag = exporting_artillery }
            }
            BEL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = BEL
            }
            BEL = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_belgian_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { BEL = { has_idea = closed_economy }}
            BEL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { BEL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            BEL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            BEL = { has_tech = interwar_antitank }
            BEL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_belgian_menu
            NOT = { 
                tag = BEL
            }
            BEL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = BEL
            }
            country_exists = BEL
        }
        icon = ger_milBELry_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #BEL = { activate_decision = exporting_anti-tank_guns }
                #BEL = { set_country_flag = exporting_anti-tank_guns }
            }
            BEL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = BEL
            }
            BEL = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_belgian_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { BEL = { has_idea = closed_economy }}
            BEL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { BEL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            BEL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            BEL = { has_tech = interwar_antiair }
            BEL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_belgian_menu
            NOT = { 
                tag = BEL
            }
            BEL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = BEL
            }
            country_exists = BEL
        }
        icon = ger_milBELry_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #BEL = { activate_decision = exporting_anti-air_guns }
                #BEL = { set_country_flag = exporting_anti-air_guns }
            }
            BEL = {
                #add_ideas = diverted_production
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = BEL
            }
            BEL = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }


    purchase_belgian_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = BEL
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { BEL = { has_idea = closed_economy }}
            BEL = {
                num_of_factories > 9
                OR = {
                    IF = {
                        Limit = { BEL = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            BEL = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            BEL = { has_tech = armored_car1 }
            BEL = { NOT = { has_capitulated = yes }}
            has_country_flag = open_belgian_menu
            NOT = { 
                tag = BEL
            }
            BEL = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = BEL
            }
            country_exists = BEL
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #BEL = { activate_decision = exporting_armored_cars }
                #BEL = { set_country_flag = exporting_armored_cars }
            }
            BEL = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }            
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = BEL
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = BEL
            }
            BEL = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }

 ###    #####      ##
#       ##       ## #
#  ##   ####     #
#   #   ##       #
 ###    #####    #

#GER
    request_permission_to_purchase_arms_from_german_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = GER }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = germany_said_yes }
            #NOT = { has_country_flag = germany_said_no }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            GER = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_german_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_german_menu }
            has_country_flag = germany_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_german_menu 
        }
    }
    close_german_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_german_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_german_menu 
        }
    }

    purchase_german_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_trains }
                #GER = { set_country_flag = exporting_trains }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_rifles }
                #GER = { set_country_flag = exporting_rifles }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_support_equipment }
                #GER = { set_country_flag = exporting_support_equipment }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production 
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_trucks }
                #GER = { set_country_flag = exporting_trucks }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            GER = { has_tech = armored_car1 }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_armored_cars }
                #GER = { set_country_flag = exporting_armored_cars }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }            
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            GER = { has_tech = mechanised_infantry }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_mechanized }
                #GER = { set_country_flag = exporting_mechanized }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_artillery }
                #GER = { set_country_flag = exporting_artillery }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_german_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            GER = { has_tech = interwar_antitank }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_anti-tank_guns }
                #GER = { set_country_flag = exporting_anti-tank_guns }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_german_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            GER = { has_tech = interwar_antiair }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_anti-air_guns }
                #GER = { set_country_flag = exporting_anti-air_guns }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = GER
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#german Tanks
    purchase_german_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 120 #not 100 cuz Panzer Is are on basic chassis. all other country's old tanks are inter-war.
        visible = {
            #GER = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_old_light_tanks }
                #GER = { set_country_flag = exporting_old_light_tanks }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_1
                    amount = 60
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_german_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #GER = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_light_tanks }
                #GER = { set_country_flag = exporting_light_tanks }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_german_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = basic_medium_tank_chassis
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_medium_tanks }
                #GER = { set_country_flag = exporting_medium_tanks }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 2
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_amphibious_tanks }
                #GER = { set_country_flag = exporting_amphibious_tanks }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_german_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_heavy_tanks }
                #GER = { set_country_flag = exporting_heavy_tanks }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_german_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_modern_tanks }
                #GER = { set_country_flag = exporting_modern_tanks }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_german_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_fighters }
                #GER = { set_country_flag = exporting_fighters }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_1
                    amount = 20
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_german_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_cas }
                #GER = { set_country_flag = exporting_cas }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_german_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_naval_bombers }
                #GER = { set_country_flag = exporting_naval_bombers }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = nav_bomber_equipment_1
                    amount = 15
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_naval_bomber_airframe
                    amount = 15
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_german_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_bombers }
                #GER = { set_country_flag = exporting_bombers }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe
                    amount = 15
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_german_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { GER = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            GER = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            GER = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = basic_large_airframe #has iw frame but no design
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_heavy_bombers }
                #GER = { set_country_flag = exporting_heavy_bombers }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = GER
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = GER
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_german_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { GER = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2 
                GER = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            GER = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_submarines }
                #GER = { set_country_flag = exporting_submarines }
            }
            GER = {
                #add_ideas = diverted_production_navy
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        GER = { has_tech = advanced_ship_hull_submarine }
                    }
                    GER = {
                        create_equipment_variant = {
                            name = "german Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "german Submarine Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = improved_ship_hull_submarine }
                    }
                    GER = {
                        create_equipment_variant = {
                            name = "german Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "german Submarine Purchase" creator = GER }
                }
                else = {
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Type VII Class" creator = GER }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Type VII Class" creator = GER }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Type VII Class" creator = GER }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        GER = { has_tech = advanced_submarine }
                    }
                    GER = {
                        create_equipment_variant = {
                            name = "german Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_4 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_4 equipment_variant = "german Submarine Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = improved_submarine }
                    }
                    GER = {
                        create_equipment_variant = {
                            name = "german Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_3 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_3 equipment_variant = "german Submarine Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = basic_submarine }
                    }
                    GER = {
                        create_equipment_variant = {
                            name = "german Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_2 equipment_variant = "german Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_2 equipment_variant = "german Submarine Purchase" creator = GER }
                }
                else = {
                    GER = {
                        create_equipment_variant = {
                            name = "german Submarine Purchase"
                            type = submarine_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 1
                                sub_engine_upgrade = 0
                            }
                        }
                    }
                    create_ship = { type = submarine_1 equipment_variant = "German Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_1 equipment_variant = "German Submarine Purchase" creator = GER }
                    create_ship = { type = submarine_1 equipment_variant = "German Submarine Purchase" creator = GER }
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
                add_political_power = 30
            }

            GER = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
#    exporting_submarines = {
#        days_remove = 150
#        visible = {
#            has_country_flag = exporting_submarines
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production_navy
#                add_political_power = 30
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -3
#                #}
#            }
#        }
#    }

    purchase_german_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { GER = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1 
                GER = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_submarines }
                #GER = { set_country_flag = exporting_submarines }
            }
            GER = {
                #add_ideas = diverted_production_navy
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        GER = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "German Destroyer Purchase" creator = GER }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "German Destroyer Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "German Destroyer Purchase" creator = GER }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "German Destroyer Purchase" creator = GER }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    #GER = {
                    #    create_equipment_variant = {
                    #        name = "Centauro Class"    
                    #        type = ship_hull_light_2
                    #        name_group = ROOT_DD_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = light_ship_engine_2
                    #            fixed_ship_torpedo_slot = ship_torpedo_1
                    #            mid_1_custom_slot = ship_mine_layer_1
                    #            rear_1_custom_slot = ship_depth_charge_1
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Zerstörer 1934A Class" creator = GER }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Zerstörer 1934A Class" creator = GER }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        GER = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "German Destroyer Purchase" creator = GER }
                    create_ship = { type = destroyer_4 equipment_variant = "German Destroyer Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "German Destroyer Purchase" creator = GER }
                    create_ship = { type = destroyer_3 equipment_variant = "German Destroyer Purchase" creator = GER }
                }
                else_if = {
                    limit = {
                        GER = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "German Destroyer Purchase" creator = GER }
                    create_ship = { type = destroyer_2 equipment_variant = "German Destroyer Purchase" creator = GER }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "German Destroyer Purchase" creator = GER }
                    create_ship = { type = destroyer_1 equipment_variant = "German Destroyer Purchase" creator = GER }
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
                add_political_power = 30
            }

            GER = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#    exporting_destroyers = {
#        days_remove = 150
#        visible = {
#            has_country_flag = exporting_destroyers
#        }
#        icon = generic_industry
#
#        complete_effect = {
#        }
#        remove_effect = {
#            effect_tooltip = {
#                #remove_ideas = diverted_production_navy
#                add_political_power = 30
#                #add_offsite_building = {
#                #    type = industrial_complex
#                #    level = -3
#                #}
#            }
#        }
#    }

    purchase_an_german_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = GER
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { GER = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            GER = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { GER = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3 
                GER = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            GER = { NOT = { has_capitulated = yes }}
            has_country_flag = open_german_menu
            NOT = { 
                tag = GER
            }
            GER = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = GER
            }
            country_exists = GER
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #GER = { activate_decision = exporting_a_cruiser }
                #GER = { set_country_flag = exporting_a_cruiser }
            }
            GER = {
                #add_ideas = diverted_production_navy
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.04 }
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = GER
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        GER = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "German Cruiser Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "German Cruiser Purchase" creator = GER }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #GER = {
                    #    create_equipment_variant = {
                    #        name = "German Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "Leipzig Class" creator = GER }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        GER = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "German Cruiser Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "German Cruiser Purchase" creator = GER }
                }
                else_if = { 
                    limit = {
                        GER = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "German Cruiser Purchase" creator = GER }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    GER = {
                        create_equipment_variant = {
                            name = "German Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "German Cruiser Purchase" creator = GER }
                }
            }
            GER = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
                add_political_power = 30
            }

            GER = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
 ####     #########      ######
##               #       ##
##              #        ##
##             #         #####
##            #          ##
##          #            ##
##         #             ##
 ####     #########      ######

#Czechoslovak Skoda bous bous
    request_permission_to_purchase_arms_from_czech_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            #is_subject = yes
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = CZE }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = czech_said_yes }
            #NOT = { has_country_flag = czech_said_no }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            CZE = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_czech_menu = { 
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_czech_menu }
            has_country_flag = czech_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_czech_menu 
        }
    }
    close_czech_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_czech_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_czech_menu 
        }
    }

    purchase_czech_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_trains }
                #CZE = { set_country_flag = exporting_trains }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.04 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_rifles }
                #CZE = { set_country_flag = exporting_rifles }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_support_equipment }
                #CZE = { set_country_flag = exporting_support_equipment }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_trucks }
                #CZE = { set_country_flag = exporting_trucks }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            CZE = { has_tech = armored_car1 }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_armored_cars }
                #CZE = { set_country_flag = exporting_armored_cars }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            CZE = { has_tech = mechanised_infantry }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_mechanized }
                #CZE = { set_country_flag = exporting_mechanized }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_artillery }
                #CZE = { set_country_flag = exporting_artillery }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_czech_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            CZE = { has_tech = interwar_antitank }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_anti-tank_guns }
                #CZE = { set_country_flag = exporting_anti-tank_guns }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_czech_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            CZE = { has_tech = interwar_antiair }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_anti-air_guns }
                #CZE = { set_country_flag = exporting_anti-air_guns }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = CZE
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#czech Tanks
    purchase_czech_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 120 #not 100 cuz vz.25 is a good design and on a basic chassis
        visible = {
            #CZE = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_old_light_tanks }
                #CZE = { set_country_flag = exporting_old_light_tanks }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_1
                    amount = 40
                    producer = CZE
                    variant_name = "LT vz. 25"
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 20
                    producer = CZE
                    variant_name = "Tancik vz. 33"                   
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_czech_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #CZE = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_light_tanks }
                #CZE = { set_country_flag = exporting_light_tanks }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_czech_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = basic_medium_tank_chassis
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_medium_tanks }
                #CZE = { set_country_flag = exporting_medium_tanks }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_amphibious_tanks }
                #CZE = { set_country_flag = exporting_amphibious_tanks }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_czech_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_heavy_tanks }
                #CZE = { set_country_flag = exporting_heavy_tanks }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_czech_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_modern_tanks }
                #CZE = { set_country_flag = exporting_modern_tanks }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_czech_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_fighters }
                #CZE = { set_country_flag = exporting_fighters }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_1
                    amount = 20
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_czech_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_cas }
                #CZE = { set_country_flag = exporting_cas }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_czech_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = basic_medium_airframe
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_bombers }
                #CZE = { set_country_flag = exporting_bombers }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe
                    amount = 15
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_czech_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = CZE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { CZE = { has_idea = closed_economy }}
            CZE = {
                num_of_factories > 19
                OR = {
                    IF = {
                        Limit = { CZE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            CZE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            CZE = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            CZE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_czech_menu
            NOT = { 
                tag = CZE
            }
            CZE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = CZE
            }
            country_exists = CZE
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #CZE = { activate_decision = exporting_heavy_bombers }
                #CZE = { set_country_flag = exporting_heavy_bombers }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = CZE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = CZE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = CZE
                }
            }
            CZE = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#no coastline = no navy exports.
#maybe can add a small decision granting navy xp or module research (old skoda plant inspection? idk)

#   ##########  ######      ###      ##
#       ##      ##  ##      ## #     ##
#       ##      ######      ##  #    ##
#       ##      ##          ##   #   ##
#       ##      ##          ##    #  ##
#   ##  ##      ##          ##     # ##
#   ##  ##      ##          ##      ###
#     ##        ##          ##       ##

#JAP
    request_permission_to_purchase_arms_from_japanese_manufacturers = {
        available = {
            IF = { 
                limit = {
                    JAP = { has_government = fascism } 
                    OR = {
                        tag = SIK
                        tag = CHI
                        tag = PRC
                        tag = SHX
                        tag = GXC
                        tag = YUN
                        tag = XSM
                    }
                }
                OR = {
                    has_completed_focus = CHI_seek_japanese_support
                    has_completed_focus = CHI_collaboration_with_the_japanese
                }
            }
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = JAP }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = japanese_said_yes }
            #NOT = { has_country_flag = japanese_said_no }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            JAP = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_japanese_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_japanese_menu }
            has_country_flag = japanese_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_japanese_menu 
        }
    }
    close_japanese_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_japanese_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_japanese_menu 
        }
    }

    purchase_japanese_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_trains }
                #JAP = { set_country_flag = exporting_trains }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_rifles }
                #JAP = { set_country_flag = exporting_rifles }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_support_equipment }
                #JAP = { set_country_flag = exporting_support_equipment }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_trucks }
                #JAP = { set_country_flag = exporting_trucks }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            JAP = { has_tech = armored_car1 }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_armored_cars }
                #JAP = { set_country_flag = exporting_armored_cars }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            JAP = { has_tech = mechanised_infantry }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_mechanized }
                #JAP = { set_country_flag = exporting_mechanized }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_artillery }
                #JAP = { set_country_flag = exporting_artillery }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_japanese_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            JAP = { has_tech = interwar_antitank }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_anti-tank_guns }
                #JAP = { set_country_flag = exporting_anti-tank_guns }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_japanese_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            JAP = { has_tech = interwar_antiair }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_anti-air_guns }
                #JAP = { set_country_flag = exporting_anti-air_guns }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = JAP
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#japanese Tanks
    purchase_japanese_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 100
        visible = {
            #JAP = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_old_light_tanks }
                #JAP = { set_country_flag = exporting_old_light_tanks }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 60
                    producer = JAP
                    variant_name = "Type 94 Tankette"                   
                }
            }
            JAP = {
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_japanese_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #JAP = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_light_tanks }
                #JAP = { set_country_flag = exporting_light_tanks }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_japanese_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = gwtank_chassis
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_medium_tanks }
                #JAP = { set_country_flag = exporting_medium_tanks }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_amphibious_tanks }
                #JAP = { set_country_flag = exporting_amphibious_tanks }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_japanese_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_heavy_tanks }
                #JAP = { set_country_flag = exporting_heavy_tanks }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_japanese_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_modern_tanks }
                #JAP = { set_country_flag = exporting_modern_tanks }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed
    purchase_japanese_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_fighters }
                #JAP = { set_country_flag = exporting_fighters }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = JAP
                }
            }
            else = {
                IF = { limit = { JAP = { NOT = { has_tech = improved_small_airframe } } }
                    add_equipment_to_stockpile = { 
                        type = small_plane_airframe_0
                        amount = 20
                        producer = JAP
                    }
                }
                else = {
                    add_equipment_to_stockpile = { 
                        type = small_plane_airframe
                        amount = 20
                        producer = JAP
                    }
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_japanese_carrier_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = cv_early_fighter
                    has_tech = iw_small_airframe
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_carrier_fighters }
                #JAP = { set_country_flag = exporting_carrier_fighters }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_fighter_equipment_0
                    amount = 20
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_airframe
                    amount = 20
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_japanese_carrier_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = cv_early_fighter
                    has_tech = iw_small_airframe
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_carrier_cas }
                #JAP = { set_country_flag = exporting_carrier_cas }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_cas_equipment_1
                    amount = 20
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_cas_airframe
                    amount = 20
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    exporting_carrier_cas = {
        days_remove = 120
        visible = {
            has_country_flag = exporting_carrier_cas
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_carrier_cas
            effect_tooltip = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_japanese_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_cas }
                #JAP = { set_country_flag = exporting_cas }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_japanese_carrier_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = cv_naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_carrier_naval_bombers }
                #JAP = { set_country_flag = exporting_carrier_naval_bombers }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_nav_bomber_equipment_1
                    amount = 15
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_naval_bomber_airframe
                    amount = 15
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_japanese_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_bombers }
                #JAP = { set_country_flag = exporting_bombers }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe
                    amount = 15
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_japanese_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { JAP = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            JAP = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            JAP = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_heavy_bombers }
                #JAP = { set_country_flag = exporting_heavy_bombers }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = JAP
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = JAP
                }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_japanese_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { JAP = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2 
                JAP = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            JAP = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_submarines }
                #JAP = { set_country_flag = exporting_submarines }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        JAP = { has_tech = advanced_ship_hull_submarine }
                    }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = improved_ship_hull_submarine }
                    }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                }
                else = {
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Submarine Purchase"               
                            type = ship_hull_submarine_2
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_2
                                rear_1_custom_slot = ship_torpedo_sub_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        JAP = { has_tech = advanced_submarine }
                    }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_4 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_4 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = improved_submarine }
                    }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_3 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_3 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = basic_submarine }
                    }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_2 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_2 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                }
                else = {
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Submarine Purchase"
                            type = submarine_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 1
                                sub_engine_upgrade = 0
                            }
                        }
                    }
                    create_ship = { type = submarine_1 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_1 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                    create_ship = { type = submarine_1 equipment_variant = "Japanese Submarine Purchase" creator = JAP }
                }
            }
            JAP = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            JAP = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_japanese_cruiser_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { JAP = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2
                JAP = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            has_dlc = "Man the Guns"
            JAP = { 
                has_tech = cruiser_submarines
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_french_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_cruiser_submarines }
                #JAP = { set_country_flag = exporting_cruiser_submarines }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 200 }
                JAP = {
                    create_equipment_variant = {
                        name = "I-1-class"               
                        type = ship_hull_cruiser_submarine
                        name_group = ROOT_SS_HISTORICAL
                        parent_version = 0
                        modules = {
                            fixed_ship_torpedo_slot = ship_torpedo_sub_1
                            fixed_ship_engine_slot = sub_ship_engine_1
                            front_1_custom_slot = ship_airplane_launcher_1
                            rear_1_custom_slot = ship_torpedo_sub_1
                        }
                    }
                }
                create_ship = { type = ship_hull_cruiser_submarine equipment_variant = "I-1-class" creator = JAP }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
                add_political_power = 30
            }

            JAP = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_japanese_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { JAP = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                JAP = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_submarines }
                #JAP = { set_country_flag = exporting_submarines }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        JAP = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Oshio Class"    
                            type = ship_hull_light_2
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_1
                                fixed_ship_anti_air_slot = ship_anti_air_1
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_2
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Oshio Class" creator = JAP }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Oshio Class" creator = JAP }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        JAP = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                    create_ship = { type = destroyer_4 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                    create_ship = { type = destroyer_3 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                }
                else_if = {
                    limit = {
                        JAP = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                    create_ship = { type = destroyer_2 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                    create_ship = { type = destroyer_1 equipment_variant = "Japanese Destroyer Purchase" creator = JAP }
                }
            }
            JAP = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            JAP = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_an_japanese_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { JAP = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3 
                JAP = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_a_cruiser }
                #JAP = { set_country_flag = exporting_a_cruiser }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        JAP = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "Japanese Cruiser Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "Japanese Cruiser Purchase" creator = JAP }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #JAP = {
                    #    create_equipment_variant = {
                    #         name = "Japanese Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "Mogami Class" creator = JAP }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        JAP = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "Japanese Cruiser Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "Japanese Cruiser Purchase" creator = JAP }
                }
                else_if = { 
                    limit = {
                        JAP = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "Japanese Cruiser Purchase" creator = JAP }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    JAP = {
                        create_equipment_variant = {
                            name = "Japanese Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "Japanese Cruiser Purchase" creator = JAP }
                }
            }
            JAP = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
            }

            JAP = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#
    purchase_an_japanese_torpedo_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = JAP
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { JAP = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            JAP = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { JAP = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3 
                JAP = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 3#300
        visible = {
            JAP = { 
                OR = {
                    JAP = { has_tech = torpedo_cruiser_mtg }
                    JAP = { has_tech = torpedo_cruiser }
                }
            }
            JAP = { NOT = { has_capitulated = yes }}
            has_country_flag = open_japanese_menu
            NOT = { 
                tag = JAP
            }
            JAP = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = JAP
            }
            country_exists = JAP
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #JAP = { activate_decision = exporting_a_torpedo_cruiser }
                #JAP = { set_country_flag = exporting_a_torpedo_cruiser }
            }
            JAP = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = JAP
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            if = {
                limit = { has_dlc = "Man the Guns" }
                create_ship = { type = ship_hull_torpedo_cruiser equipment_variant = "Torpedo Cruiser" creator = JAP }
            }
            else = { #NO MTG
                create_ship = { type = torpedo_cruiser equipment_variant = "Torpedo Cruiser" creator = JAP }
            }
            JAP = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            JAP = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    exporting_a_torpedo_cruiser = {
        days_remove = 20
        visible = {
            has_country_flag = exporting_a_torpedo_cruiser
        }
        icon = generic_industry

        complete_effect = {
        }
        remove_effect = {
            clr_country_flag = exporting_a_torpedo_cruiser
            effect_tooltip = {
                #remove_ideas = diverted_production_navy
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }   
########################################################################
########################################################################
########################################################################SOVIET UNION
########################################################################
########################################################################
########################################################################
########################################################################
########################################################################
########################################################################

    request_permission_to_purchase_arms_from_soviet_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = SOV }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = soviet_said_yes }
            #NOT = { has_country_flag = soviet_said_no }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            SOV = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_soviet_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_soviet_menu }
            has_country_flag = soviet_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_soviet_menu 
        }
    }
    close_soviet_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_soviet_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_soviet_menu 
        }
    }

    purchase_soviet_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_trains }
                #SOV = { set_country_flag = exporting_trains }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_soviet_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_rifles }
                #SOV = { set_country_flag = exporting_rifles }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_soviet_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_support_equipment }
                #SOV = { set_country_flag = exporting_support_equipment }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_soviet_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_trucks }
                #SOV = { set_country_flag = exporting_trucks }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_soviet_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SOV = { has_tech = armored_car1 }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_armored_cars }
                #SOV = { set_country_flag = exporting_armored_cars }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_soviet_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SOV = { has_tech = mechanised_infantry }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_mechanized }
                #SOV = { set_country_flag = exporting_mechanized }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_soviet_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_artillery }
                #SOV = { set_country_flag = exporting_artillery }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_soviet_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SOV = { has_tech = interwar_antitank }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_anti-tank_guns }
                #SOV = { set_country_flag = exporting_anti-tank_guns }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_soviet_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SOV = { has_tech = interwar_antiair }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_anti-air_guns }
                #SOV = { set_country_flag = exporting_anti-air_guns }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = SOV
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#soviet Tanks
    purchase_soviet_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 120 #t-26 is basic chassis (and good design tbh)
        visible = {
            #SOV = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_old_light_tanks }
                #SOV = { set_country_flag = exporting_old_light_tanks }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_1
                    amount = 60
                    producer = SOV
                    variant_name = "T-26TU mod. 1933"                   
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_soviet_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #SOV = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_light_tanks }
                #SOV = { set_country_flag = exporting_light_tanks }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_soviet_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SOV = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = gwtank_chassis
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_medium_tanks }
                #SOV = { set_country_flag = exporting_medium_tanks }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_soviet_medium_td = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SOV = { 
                has_tech = improved_medium_tank_chassis
                has_completed_focus = SOV_soviet_artillery
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_medium_td }
                #SOV = { set_country_flag = exporting_medium_td }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_destroyer_chassis
                    amount = 50
                    producer = SOV
                }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_soviet_medium_spg = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SOV = { 
                has_tech = improved_medium_tank_chassis
                has_completed_focus = SOV_soviet_artillery
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_medium_spg }
                #SOV = { set_country_flag = exporting_medium_spg }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_artillery_chassis
                    amount = 50
                    producer = SOV
                }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }


    purchase_soviet_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SOV = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_amphibious_tanks }
                #SOV = { set_country_flag = exporting_amphibious_tanks }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_soviet_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            SOV = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = gwtank_chassis 
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_heavy_tanks }
                #SOV = { set_country_flag = exporting_heavy_tanks }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_soviet_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            SOV = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_modern_tanks }
                #SOV = { set_country_flag = exporting_modern_tanks }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed
    purchase_soviet_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            SOV = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_fighters }
                #SOV = { set_country_flag = exporting_fighters }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_soviet_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            SOV = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_bombers }
                #SOV = { set_country_flag = exporting_bombers }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe
                    amount = 15
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_soviet_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { SOV = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SOV = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SOV = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_heavy_bombers }
                #SOV = { set_country_flag = exporting_heavy_bombers }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = SOV
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = SOV
                }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_soviet_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SOV = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2 
                SOV = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            SOV = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_submarines }
                #SOV = { set_country_flag = exporting_submarines }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        SOV = { has_tech = advanced_ship_hull_submarine }
                    }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = improved_ship_hull_submarine }
                    }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                }
                else = {
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Series IX Srednyaya" creator = SOV }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Series IX Srednyaya" creator = SOV }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Series II Leninets" creator = SOV }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        SOV = { has_tech = advanced_submarine }
                    }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_4 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_4 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = improved_submarine }
                    }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_3 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_3 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = basic_submarine }
                    }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_2 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_2 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                }
                else = {
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Submarine Purchase"
                            type = submarine_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 1
                                sub_engine_upgrade = 0
                            }
                        }
                    }
                    create_ship = { type = submarine_1 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_1 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                    create_ship = { type = submarine_1 equipment_variant = "Soviet Submarine Purchase" creator = SOV }
                }
            }
            SOV = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            SOV = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_soviet_cruiser_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SOV = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2
                SOV = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            has_dlc = "Man the Guns"
            SOV = { 
                has_tech = cruiser_submarines
            }
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_cruiser_submarines }
                #SOV = { set_country_flag = exporting_cruiser_submarines }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 200 }
                create_ship = { type = ship_hull_cruiser_submarine equipment_variant = "K Class" creator = SOV }
            SOV = {
                add_political_power = 30
            }
            SOV = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_soviet_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SOV = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1 
                SOV = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_submarines }
                #SOV = { set_country_flag = exporting_submarines }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        SOV = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Leningrad & Minsk Class" creator = SOV }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Leningrad & Minsk Class" creator = SOV }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        SOV = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                    create_ship = { type = destroyer_4 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                    create_ship = { type = destroyer_3 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                }
                else_if = {
                    limit = {
                        SOV = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                    create_ship = { type = destroyer_2 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                    create_ship = { type = destroyer_1 equipment_variant = "Soviet Destroyer Purchase" creator = SOV }
                }
            }
            SOV = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            SOV = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_an_soviet_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SOV
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SOV = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SOV = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { SOV = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3 
                SOV = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            SOV = { NOT = { has_capitulated = yes }}
            has_country_flag = open_soviet_menu
            NOT = { 
                tag = SOV
            }
            SOV = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SOV
            }
            country_exists = SOV
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #SOV = { activate_decision = exporting_a_cruiser }
                #SOV = { set_country_flag = exporting_a_cruiser }
            }
            SOV = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SOV
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        SOV = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_2
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "Soviet Cruiser Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "Soviet Cruiser Purchase" creator = SOV }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    SOV = {
                        create_equipment_variant = {
                             name = "Soviet Cruiser Purchase"    
                            type = ship_hull_cruiser_2
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "Soviet Cruiser Purchase" creator = SOV }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        SOV = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "Soviet Cruiser Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "Soviet Cruiser Purchase" creator = SOV }
                }
                else_if = { 
                    limit = {
                        SOV = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "Soviet Cruiser Purchase" creator = SOV }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    SOV = {
                        create_equipment_variant = {
                            name = "Soviet Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "Soviet Cruiser Purchase" creator = SOV }
                }
            }
            SOV = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            SOV = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    #USA USA USA USA USA USA USA USA USA USA
############################################################################
#############################################################################
#############################################################################
#############################################################################
#############################################################################
#############################################################################
#############################################################################
#############################################################################
    request_permission_to_purchase_arms_from_american_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = USA }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = america_said_yes }
            #NOT = { has_country_flag = america_said_no }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            USA = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_american_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_american_menu }
            has_country_flag = america_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_american_menu 
        }
    }
    close_american_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_american_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_american_menu 
        }
    }

    purchase_american_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_trains }
                #USA = { set_country_flag = exporting_trains }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_rifles }
                #USA = { set_country_flag = exporting_rifles }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_support_equipment }
                #USA = { set_country_flag = exporting_support_equipment }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_trucks }
                #USA = { set_country_flag = exporting_trucks }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            USA = { has_tech = armored_car1 }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_armored_cars }
                #USA = { set_country_flag = exporting_armored_cars }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            USA = { has_tech = mechanised_infantry }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_mechanized }
                #USA = { set_country_flag = exporting_mechanized }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_artillery }
                #USA = { set_country_flag = exporting_artillery }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_american_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            USA = { has_tech = interwar_antitank }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_anti-tank_guns }
                #USA = { set_country_flag = exporting_anti-tank_guns }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_american_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            USA = { has_tech = interwar_antiair }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_anti-air_guns }
                #USA = { set_country_flag = exporting_anti-air_guns }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = USA
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#american Tanks
    purchase_american_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 120 #basic chassis
        visible = {
            USA = { 
                OR = {
                    has_tech = improved_light_tank
                    has_tech = improved_light_tank_chassis
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_old_light_tanks }
                #USA = { set_country_flag = exporting_old_light_tanks }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_1
                    amount = 60
                    producer = USA             
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_american_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #USA = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_light_tanks }
                #USA = { set_country_flag = exporting_light_tanks }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_american_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = basic_medium_tank_chassis
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_medium_tanks }
                #USA = { set_country_flag = exporting_medium_tanks }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_amphibious_tanks }
                #USA = { set_country_flag = exporting_amphibious_tanks }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_american_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_heavy_tanks }
                #USA = { set_country_flag = exporting_heavy_tanks }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_american_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_modern_tanks }
                #USA = { set_country_flag = exporting_modern_tanks }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed
    purchase_american_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_fighters }
                #USA = { set_country_flag = exporting_fighters }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_american_carrier_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = cv_early_fighter
                    has_tech = iw_small_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_carrier_fighters }
                #USA = { set_country_flag = exporting_carrier_fighters }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_fighter_equipment_0
                    amount = 20
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_airframe
                    amount = 20
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_american_carrier_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = cv_early_fighter
                    has_tech = iw_small_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_carrier_cas }
                #USA = { set_country_flag = exporting_carrier_cas }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_cas_equipment_1
                    amount = 20
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_cas_airframe
                    amount = 20
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_american_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_cas }
                #USA = { set_country_flag = exporting_cas }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_american_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = cv_naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_naval_bombers }
                #USA = { set_country_flag = exporting_naval_bombers }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = nav_bomber_equipment_1
                    amount = 15
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe_1
                    amount = 15
                    producer = USA
                    variant_name = "PBY"
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_american_carrier_naval_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = cv_naval_bomber1
                    has_tech = iw_small_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_carrier_naval_bombers }
                #USA = { set_country_flag = exporting_carrier_naval_bombers }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = cv_nav_bomber_equipment_1
                    amount = 15
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = cv_small_plane_naval_bomber_airframe
                    amount = 15
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_american_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_bombers }
                #USA = { set_country_flag = exporting_bombers }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe_1
                    amount = 15
                    producer = USA
                    variant_name = "B-18"
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_american_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { USA = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            USA = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            USA = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_heavy_bombers }
                #USA = { set_country_flag = exporting_heavy_bombers }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = USA
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = USA
                }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_american_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { USA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2 
                USA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            USA = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_submarines }
                #USA = { set_country_flag = exporting_submarines }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        USA = { has_tech = advanced_ship_hull_submarine }
                    }
                    USA = {
                        create_equipment_variant = {
                            name = "American Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "American Submarine Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_ship_hull_submarine }
                    }
                    USA = {
                        create_equipment_variant = {
                            name = "American Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "American Submarine Purchase" creator = USA }
                }
                else = {
                    USA = {
                        create_equipment_variant = {
                            name = "American Submarine Purchase"               
                            type = ship_hull_submarine_2
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_2
                                rear_1_custom_slot = ship_torpedo_sub_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "American Submarine Purchase" creator = USA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        USA = { has_tech = advanced_submarine }
                    }
                    USA = {
                        create_equipment_variant = {
                            name = "American Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = submarine_4 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = submarine_4 equipment_variant = "American Submarine Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_submarine }
                    }
                    USA = {
                        create_equipment_variant = {
                            name = "American Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = submarine_3 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = submarine_3 equipment_variant = "American Submarine Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = basic_submarine }
                    }
                    USA = {
                        create_equipment_variant = {
                            name = "American Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = submarine_2 equipment_variant = "American Submarine Purchase" creator = USA }
                    create_ship = { type = submarine_2 equipment_variant = "American Submarine Purchase" creator = USA }
                }
                else = {
                    create_ship = { type = submarine_1 equipment_variant = "Porpoise Class" creator = USA }
                    create_ship = { type = submarine_1 equipment_variant = "Porpoise Class" creator = USA }
                    create_ship = { type = submarine_1 equipment_variant = "Porpoise Class" creator = USA }
                }
            }
            USA = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            USA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_american_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { USA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1
                USA = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_submarines }
                #USA = { set_country_flag = exporting_submarines }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        USA = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "American Destroyer Purchase" creator = USA }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "American Destroyer Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "American Destroyer Purchase" creator = USA }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "American Destroyer Purchase" creator = USA }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    USA = {
                        create_equipment_variant = {
                            name = "Porter Class"    
                            type = ship_hull_light_2
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_1
                                fixed_ship_anti_air_slot = ship_anti_air_1
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_2
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Porter Class" creator = USA }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Porter Class" creator = USA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        USA = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "American Destroyer Purchase" creator = USA }
                    create_ship = { type = destroyer_4 equipment_variant = "American Destroyer Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "American Destroyer Purchase" creator = USA }
                    create_ship = { type = destroyer_3 equipment_variant = "American Destroyer Purchase" creator = USA }
                }
                else_if = {
                    limit = {
                        USA = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "American Destroyer Purchase" creator = USA }
                    create_ship = { type = destroyer_2 equipment_variant = "American Destroyer Purchase" creator = USA }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "American Destroyer Purchase" creator = USA }
                    create_ship = { type = destroyer_1 equipment_variant = "American Destroyer Purchase" creator = USA }
                }
            }
            USA = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            USA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_an_american_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { USA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3 
                USA = {
                    has_opinion = {
                        target = ROOT
                        value > 39
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_a_cruiser }
                #USA = { set_country_flag = exporting_a_cruiser }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        USA = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "American Cruiser Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "American Cruiser Purchase" creator = USA }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #USA = {
                    #    create_equipment_variant = {
                    #         name = "American Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "Brooklyn Class" creator = USA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        USA = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "American Cruiser Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "American Cruiser Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "American Cruiser Purchase" creator = USA }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "American Cruiser Purchase" creator = USA }
                }
            }
            USA = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            USA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_an_american_heavy_cruiser = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = USA
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { USA = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            USA = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { USA = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3
                USA = {
                    has_opinion = {
                        target = ROOT
                        value > 49
                    }
                }
        }
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 360
        visible = {
            USA = { NOT = { has_capitulated = yes }}
            has_country_flag = open_american_menu
            NOT = { 
                tag = USA
            }
            USA = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = USA
            }
            country_exists = USA
        }
        icon = generic_naval
        cost = 25
        complete_effect = {
            hidden_effect = {
                #USA = { activate_decision = exporting_a_heavy_cruiser }
                #USA = { set_country_flag = exporting_a_heavy_cruiser }
            }
            USA = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.05 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = USA
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        USA = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Heavy Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_medium_battery_2 #ship_medium_battery_1
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_3
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_4
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_3
                                mid_1_custom_slot = ship_torpedo_2
                                mid_2_custom_slot = ship_airplane_launcher_2
                                rear_1_custom_slot = ship_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "American Heavy Cruiser Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Heavy Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_2
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_2
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "American Heavy Cruiser Purchase" creator = USA }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #USA = {
                    #    create_equipment_variant = {
                    #         name = "American Heavy Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_2 equipment_variant = "New Orleans Class" creator = USA }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        USA = { has_tech = advanced_heavy_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Heavy Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_4 equipment_variant = "American Heavy Cruiser Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = improved_heavy_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Heavy Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_3 equipment_variant = "American Heavy Cruiser Purchase" creator = USA }
                }
                else_if = { 
                    limit = {
                        USA = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Heavy Cruiser Purchase"
                            type = heavy_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_2 equipment_variant = "American Heavy Cruiser Purchase" creator = USA }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    USA = {
                        create_equipment_variant = {
                            name = "American Heavy Cruiser Purchase"
                            type = heavy_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_1 equipment_variant = "American Heavy Cruiser Purchase" creator = USA }
                }
            }
            USA = {
                add_political_power = 25
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.05 }
            }

            USA = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
#############################################################################################
############################################################################################# SWEDEN
#############################################################################################

    request_permission_to_purchase_arms_from_swedish_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = SWE }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        days_re_enable = 365
        visible = {
            NOT = { has_country_flag = sweden_said_yes }
            #NOT = { has_country_flag = sweden_said_no }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            SWE = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_swedish_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_swedish_menu }
            has_country_flag = sweden_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_swedish_menu 
        }
    }
    close_swedish_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_swedish_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_swedish_menu 
        }
    }

    purchase_swedish_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_trains }
                #SWE = { set_country_flag = exporting_trains }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_rifles }
                #SWE = { set_country_flag = exporting_rifles }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_support_equipment }
                #SWE = { set_country_flag = exporting_support_equipment }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            SWE = { has_tech = motorised_infantry }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_trucks }
                #SWE = { set_country_flag = exporting_trucks }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SWE = { has_tech = armored_car1 }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_armored_cars }
                #SWE = { set_country_flag = exporting_armored_cars }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SWE = { has_tech = mechanised_infantry }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_mechanized }
                #SWE = { set_country_flag = exporting_mechanized }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_artillery }
                #SWE = { set_country_flag = exporting_artillery }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_swedish_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SWE = { has_tech = interwar_antitank }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_anti-tank_guns }
                #SWE = { set_country_flag = exporting_anti-tank_guns }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_swedish_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            SWE = { has_tech = interwar_antiair }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_anti-air_guns }
                #SWE = { set_country_flag = exporting_anti-air_guns }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = SWE
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

#swedish Tanks
    purchase_swedish_old_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 120 #basic chassis
        visible = {
            SWE = { 
                OR = {
                    has_tech = improved_light_tank
                    has_tech = improved_light_tank_chassis
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_tank
        cost = 25

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_old_light_tanks }
                #SWE = { set_country_flag = exporting_old_light_tanks }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis_0
                    amount = 60
                    producer = SWE             
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    purchase_swedish_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            #SWE = { 
            #    OR = {
            #        has_tech = basic_light_tank
            #        has_tech = gwtank_chassis
            #    }
            #}
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_light_tanks }
                #SWE = { set_country_flag = exporting_light_tanks }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = SWE
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_swedish_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SWE = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = basic_medium_tank_chassis
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_medium_tanks }
                #SWE = { set_country_flag = exporting_medium_tanks }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = SWE
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SWE = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_amphibious_tanks }
                #SWE = { set_country_flag = exporting_amphibious_tanks }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = SWE
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_swedish_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            SWE = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_heavy_tanks }
                #SWE = { set_country_flag = exporting_heavy_tanks }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = SWE
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_swedish_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            SWE = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_modern_tanks }
                #SWE = { set_country_flag = exporting_modern_tanks }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = SWE
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed
    purchase_swedish_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            SWE = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_fighters }
                #SWE = { set_country_flag = exporting_fighters }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = SWE
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_swedish_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            SWE = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_bombers }
                #SWE = { set_country_flag = exporting_bombers }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe_1
                    amount = 15
                    producer = SWE
                    variant_name = "B-18"
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_swedish_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { SWE = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            SWE = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            SWE = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_heavy_bombers }
                #SWE = { set_country_flag = exporting_heavy_bombers }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = SWE
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = SWE
                }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_swedish_submarines = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SWE = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 2 
                SWE = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 150
        visible = {
            SWE = { 
                OR = {
                    has_tech = basic_submarine
                    has_tech = basic_ship_hull_submarine
                }
            }
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_submarines }
                #SWE = { set_country_flag = exporting_submarines }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            hidden_effect = { add_manpower = 600 }
            if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_ship_hull_submarine }
                    }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Submarine Purchase"               
                            type = ship_hull_submarine_4
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_4
                                rear_1_custom_slot = ship_torpedo_sub_3
                                front_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = ship_hull_submarine_4 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_ship_hull_submarine }
                    }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Submarine Purchase"               
                            type = ship_hull_submarine_3
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_3
                                fixed_ship_engine_slot = sub_ship_engine_3
                                rear_1_custom_slot = ship_torpedo_sub_3
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = ship_hull_submarine_3 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                }
                else = {
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Submarine Purchase"               
                            type = ship_hull_submarine_2
                            name_group = ROOT_SS_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_torpedo_slot = ship_torpedo_sub_2
                                fixed_ship_engine_slot = sub_ship_engine_2
                                rear_1_custom_slot = ship_torpedo_sub_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = ship_hull_submarine_2 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_submarine }
                    }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Submarine Purchase"
                            type = submarine_4
                            upgrades = {
                                ship_reliability_upgrade = 3
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 3
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_4 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = submarine_4 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = submarine_4 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_submarine }
                    }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Submarine Purchase"
                            type = submarine_3
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 3
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = submarine_3 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = submarine_3 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = submarine_3 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = basic_submarine }
                    }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Submarine Purchase"
                            type = submarine_2
                            upgrades = {
                                ship_reliability_upgrade = 2
                                sub_torpedo_upgrade = 2
                                sub_stealth_upgrade = 2
                                sub_engine_upgrade = 1
                            }
                        }
                    }
                    create_ship = { type = submarine_2 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = submarine_2 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                    create_ship = { type = submarine_2 equipment_variant = "Swedish Submarine Purchase" creator = SWE }
                }
                else = {
                    create_ship = { type = submarine_1 equipment_variant = "Draken Class" creator = SWE }
                    create_ship = { type = submarine_1 equipment_variant = "Draken Class" creator = SWE }
                    create_ship = { type = submarine_1 equipment_variant = "Draken Class" creator = SWE }
                }
            }
            SWE = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            SWE = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_swedish_destroyers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SWE = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 1 
                SWE = {
                    has_opinion = {
                        target = ROOT
                        value > 19
                    }
                }
        }
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 200
        visible = {
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_submarines }
                #SWE = { set_country_flag = exporting_submarines }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 1000 }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Destroyer Purchase"    
                            type = ship_hull_light_4
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_4
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                    create_ship = { type = ship_hull_light_4 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_ship_hull_light }
                    }
                    hidden_effect = { add_manpower = 800 }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Destroyer Purchase"    
                            type = ship_hull_light_3
                            name_group = ROOT_DD_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = light_ship_engine_3
                                fixed_ship_torpedo_slot = ship_torpedo_1
                                mid_1_custom_slot = ship_mine_layer_1
                                rear_1_custom_slot = ship_depth_charge_1
                            }
                        }
                    }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                    create_ship = { type = ship_hull_light_3 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                }
                else = {
                    hidden_effect = { add_manpower = 650 }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Göteborg Class" creator = SWE }
                    create_ship = { type = ship_hull_light_2 equipment_variant = "Göteborg Class" creator = SWE }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_destroyer }
                    }
                    hidden_effect = { add_manpower = 500 }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Destroyer Purchase"
                            type = destroyer_4
                            upgrades = {
                                ship_torpedo_upgrade = 4
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_4 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                    create_ship = { type = destroyer_4 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_destroyer }
                    }
                    hidden_effect = { add_manpower = 400 }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Destroyer Purchase"
                            type = destroyer_3
                            upgrades = {
                                ship_torpedo_upgrade = 3
                                destroyer_engine_upgrade = 2
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_3 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                    create_ship = { type = destroyer_3 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                }
                else_if = {
                    limit = {
                        SWE = { has_tech = basic_destroyer }
                    }
                    hidden_effect = { add_manpower = 25 }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Destroyer Purchase"
                            type = destroyer_2
                            upgrades = {
                                ship_torpedo_upgrade = 2
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = destroyer_2 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                    create_ship = { type = destroyer_2 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                }
                else = {                
                    hidden_effect = { add_manpower = 250 }
                    SWE = {
                        create_equipment_variant = {
                            name = "Swedish Destroyer Purchase"
                            type = destroyer_1
                            upgrades = {
                                ship_torpedo_upgrade = 1
                                destroyer_engine_upgrade = 1
                                ship_ASW_upgrade = 2
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = destroyer_1 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                    create_ship = { type = destroyer_1 equipment_variant = "Swedish Destroyer Purchase" creator = SWE }
                }
            }
            SWE = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            SWE = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }

    purchase_an_swedish_cruiser = { # always = no #will sort out later.
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SWE = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3 
                SWE = {
                    has_opinion = {
                        target = ROOT
                        value > 39
                    }
                }
        }
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 300
        visible = {
            always = no #will sort out later.
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_human_torpedo
        cost = 30
        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_a_cruiser }
                #SWE = { set_country_flag = exporting_a_cruiser }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.03 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "swedish Cruiser Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_light_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_1
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_light_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "swedish Cruiser Purchase" creator = SWE }
                }
                else = {
                    hidden_effect = { add_manpower = 800 }
                    #SWE = {
                    #    create_equipment_variant = {
                    #         name = "swedish Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_coastal_defense_ship equipment_variant = "Flygia Class" creator = SWE }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_4 equipment_variant = "swedish Cruiser Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_3 equipment_variant = "swedish Cruiser Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Cruiser Purchase"
                            type = light_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_2 equipment_variant = "swedish Cruiser Purchase" creator = SWE }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Cruiser Purchase"
                            type = light_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = light_cruiser_1 equipment_variant = "swedish Cruiser Purchase" creator = SWE }
                }
            }
            SWE = {
                add_political_power = 30
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_dockyard = 0.03 }
            }

            SWE = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    purchase_an_swedish_heavy_cruiser = { #coastal defence ship!
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = SWE
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        NOT = { SWE = { has_idea = closed_economy }}
        NOT = { ROOT = { has_idea = closed_economy }}
            SWE = {
                num_of_factories > 14
                OR = {
                    IF = {
                        Limit = { SWE = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        num_of_civilian_factories_available_for_projects > 3
                SWE = {
                    has_opinion = {
                        target = ROOT
                        value > 49
                    }
                }
        }
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 360
        visible = {
            SWE = { NOT = { has_capitulated = yes }}
            has_country_flag = open_swedish_menu
            NOT = { 
                tag = SWE
            }
            SWE = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = SWE
            }
            country_exists = SWE
        }
        icon = generic_naval
        cost = 25
        complete_effect = {
            hidden_effect = {
                #SWE = { activate_decision = exporting_a_heavy_cruiser }
                #SWE = { set_country_flag = exporting_a_heavy_cruiser }
            }
            SWE = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.05 }
                #add_ideas = diverted_production_navy
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = SWE
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
                        if = {
                limit = { has_dlc = "Man the Guns" }
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1400 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Heavy Cruiser Purchase"    
                            type = ship_hull_cruiser_4
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_medium_battery_2 #ship_medium_battery_1
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_3
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_4
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_3
                                mid_1_custom_slot = ship_torpedo_2
                                mid_2_custom_slot = ship_airplane_launcher_2
                                rear_1_custom_slot = ship_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_4 equipment_variant = "swedish Heavy Cruiser Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_ship_hull_cruiser }
                    }
                    hidden_effect = { add_manpower = 1200 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Heavy Cruiser Purchase"    
                            type = ship_hull_cruiser_3
                            name_group = ROOT_CL_HISTORICAL
                            parent_version = 0
                            modules = {
                                fixed_ship_battery_slot = ship_medium_battery_2
                                fixed_ship_anti_air_slot = ship_anti_air_2
                                fixed_ship_fire_control_system_slot = ship_fire_control_system_2
                                fixed_ship_radar_slot = empty
                                fixed_ship_engine_slot = cruiser_ship_engine_2
                                fixed_ship_armor_slot = empty
                                front_1_custom_slot = ship_anti_air_2
                                mid_1_custom_slot = ship_torpedo_1
                                mid_2_custom_slot = ship_airplane_launcher_1
                                rear_1_custom_slot = ship_medium_battery_2
                            }
                        }
                    }
                    create_ship = { type = ship_hull_cruiser_3 equipment_variant = "swedish Heavy Cruiser Purchase" creator = SWE }
                }
                else = {
                    hidden_effect = { add_manpower = 1800 }
                    #SWE = {
                    #    create_equipment_variant = {
                    #         name = "swedish Heavy Cruiser Purchase"    
                    #        type = ship_hull_cruiser_2
                    #        name_group = ROOT_CL_HISTORICAL
                    #        parent_version = 0
                    #        modules = {
                    #            fixed_ship_battery_slot = ship_light_medium_battery_2
                    #            fixed_ship_anti_air_slot = ship_anti_air_2
                    #            fixed_ship_fire_control_system_slot = ship_fire_control_system_1
                    #            fixed_ship_radar_slot = empty
                    #            fixed_ship_engine_slot = cruiser_ship_engine_2
                    #            fixed_ship_armor_slot = empty
                    #            front_1_custom_slot = ship_anti_air_1
                    #            mid_1_custom_slot = ship_torpedo_1
                    #            mid_2_custom_slot = ship_airplane_launcher_1
                    #            rear_1_custom_slot = ship_light_medium_battery_2
                    #        }
                    #    }
                    #}
                    create_ship = { type = ship_hull_cruiser_coastal_defense_ship equipment_variant = "Sverige" creator = SWE }
                }
            }
            else = { #NO MTG
                if = { 
                    limit = {
                        SWE = { has_tech = advanced_heavy_cruiser }
                    }
                    hidden_effect = { add_manpower = 1140 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Heavy Cruiser Purchase"
                            type = light_cruiser_4
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 3
                                ship_gun_upgrade = 4
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_4 equipment_variant = "swedish Heavy Cruiser Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = improved_heavy_cruiser }
                    }
                    hidden_effect = { add_manpower = 960 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Heavy Cruiser Purchase"
                            type = light_cruiser_3
                            upgrades = {
                                ship_reliability_upgrade = 4
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 3
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_3 equipment_variant = "Swedish Heavy Cruiser Purchase" creator = SWE }
                }
                else_if = { 
                    limit = {
                        SWE = { has_tech = basic_light_cruiser }
                    }
                    hidden_effect = { add_manpower = 800 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Heavy Cruiser Purchase"
                            type = heavy_cruiser_2
                            upgrades = {
                                ship_reliability_upgrade = 3
                                ship_engine_upgrade = 2
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_2 equipment_variant = "Swedish Heavy Cruiser Purchase" creator = SWE }
                }
                else = {
                    hidden_effect = { add_manpower = 600 }
                    SWE = {
                        create_equipment_variant = {
                            name = "swedish Heavy Cruiser Purchase"
                            type = heavy_cruiser_1
                            upgrades = {
                                ship_reliability_upgrade = 2
                                ship_engine_upgrade = 1
                                ship_gun_upgrade = 3
                                ship_anti_air_upgrade = 2
                            }
                        }
                    }
                    create_ship = { type = heavy_cruiser_1 equipment_variant = "Swedish Heavy Cruiser Purchase" creator = SWE }
                }
            }
            SWE = {
                add_political_power = 25
                add_to_variable = { IAM_industrial_factory_donations = -4 }
                add_to_variable = { IAM_industrial_capacity_dockyard = -0.05 }
            }

            SWE = {
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }


############################################################################
#hungary
#       #   #       #      #        #
#       #   #       #      ##       #
#       #   #       #      # #      #
#########   #       #      #  #     #
#       #   #       #      #   #    #
#       #   #       #      #    #   #
#       #   #       #      #     #  #
#       #   #########      #      ##
    request_permission_to_purchase_arms_from_hungary_manufacturers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            NOT = { HUN = { has_idea = HUN_treaty_of_triannon } }
            HUN = { num_of_factories > 25 }            
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            NOT = { is_embargoed_by = HUN }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
        }
        visible = {
            NOT = { has_country_flag = hungary_said_yes }
            NOT = { has_country_flag = hungary_said_no }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        icon = generic_construction
        cost = 0
        complete_effect = {
            HUN = { country_event = armsmarket.1 }
        }
        remove_effect = {
        }
    }

    open_hungary_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            NOT = { has_country_flag = open_hungary_menu }
            has_country_flag = hungary_said_yes
        }
        ai_will_do = {
            factor = 0#10
            modifier = {
                has_global_flag = no_ai_purchases
                }
                factor = 0
            }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            set_country_flag = open_hungary_menu 
        }
    }
    close_hungary_menu = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
        }
        visible = {
            has_country_flag = open_hungary_menu 
        }
        #icon = generic_construction
        cost = 0
        complete_effect = {
            clr_country_flag = open_hungary_menu 
        }
    }

    purchase_hungary_trains = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            #has_equipment = {
            #    train_equipment > 2
            #}
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = train_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_factory
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_trains }
                #HUN = { set_country_flag = exporting_trains }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = { 
                Limit = { NOT = { has_tech = basic_train } }
                custom_effect_tooltip = train_tech_boost_first_time
                add_tech_bonus = {
                    bonus = 0.5
                    uses = 1
                    category = train_tech
                }
            }
            add_equipment_to_stockpile = {
                type = train_equipment
                amount = 10
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_rifles = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_rifles }
                #HUN = { set_country_flag = exporting_rifles }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 500
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_support_equipment = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = support_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_merge_plant_materiel
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_support_equipment }
                #HUN = { set_country_flag = exporting_support_equipment }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = support_equipment_1
                amount = 25
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_trucks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = motorized_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 45
        visible = {
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_trucks
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_trucks }
                #HUN = { set_country_flag = exporting_trucks }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = motorized_equipment_1
                amount = 25
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_armored_cars = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            HUN = { has_tech = armored_car1 }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_armored_cars }
                #HUN = { set_country_flag = exporting_armored_cars }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = armored_car_equipment
                amount = 60
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_mechanized = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = infantry_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            HUN = { has_tech = mechanised_infantry }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_industry
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_mechanized }
                #HUN = { set_country_flag = exporting_mechanized }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }

            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = mechanized_equipment
                amount = 50
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_artillery = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        cost = 20
        days_remove = 90
        visible = {
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = ger_military_buildup

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_artillery }
                #HUN = { set_country_flag = exporting_artillery }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_hungary_anti-tank_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = artillery_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            HUN = { has_tech = interwar_antitank }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_anti-tank_guns }
                #HUN = { set_country_flag = exporting_anti-tank_guns }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 36
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_hungary_anti-air_guns = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 0
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        ai_will_do = {
            factor = 0.1
            modifier = {
                OR = {
                    num_of_civilian_factories < 5
                    stockpile_ratio = { 
                        archetype = anti_air_equipment
                        ratio > 3
                    }
                }
                factor = 0
            }
            modifier = {
                has_war = yes
                factor = 10
            }
        }
        modifier = {
            civilian_factory_use = 1
        }
        days_remove = 90
        visible = {
            HUN = { has_tech = interwar_antiair }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = ger_military_buildup
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_anti-air_guns }
                #HUN = { set_country_flag = exporting_anti-air_guns }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 1 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 1
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            add_equipment_to_stockpile = {
                type = anti_air_equipment
                amount = 30
                producer = HUN
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -1 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -1
                #}
            }
        }
    }
    #export duplicate removed

    purchase_hungary_light_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = basic_light_tank
                    has_tech = gwtank_chassis
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_light_tanks }
                #HUN = { set_country_flag = exporting_light_tanks }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = light_tank_equipment_1
                    amount = 60
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = light_tank_chassis
                    amount = 60
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    #export duplicate removed

    purchase_hungary_medium_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = basic_medium_tank
                    has_tech = basic_medium_tank_chassis
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_medium_tanks }
                #HUN = { set_country_flag = exporting_medium_tanks }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = medium_tank_equipment_1
                    amount = 50
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_tank_chassis
                    amount = 50
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_amphibious_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = amphibious_tank
                    has_tech = amphibious_tank_chassis
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_amphibious_tanks }
                #HUN = { set_country_flag = exporting_amphibious_tanks }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_equipment_1
                    amount = 50
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = amphibious_tank_chassis
                    amount = 50
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
    #export duplicate removed


    purchase_hungary_heavy_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 3
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = basic_heavy_tank
                    has_tech = basic_heavy_tank_chassis
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_heavy_tanks }
                #HUN = { set_country_flag = exporting_heavy_tanks }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = heavy_tank_equipment_1
                    amount = 50
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = heavy_tank_chassis
                    amount = 50
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed

    purchase_hungary_modern_tanks = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 3
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 4
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = main_battle_tank
                    has_tech = main_battle_tank_chassis
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_tank
        cost = 30

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_modern_tanks }
                #HUN = { set_country_flag = exporting_modern_tanks }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 4
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                add_equipment_to_stockpile = { 
                    type = modern_tank_equipment_1
                    amount = 50
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = modern_tank_chassis_1
                    amount = 50
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 4 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 30
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -4
                #}
            }
        }
    }
    #export duplicate removed
    purchase_hungary_fighters = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = early_fighter
                    has_tech = iw_small_airframe
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_fighters }
                #HUN = { set_country_flag = exporting_fighters }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = fighter_equipment_0
                    amount = 20
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_airframe
                    amount = 20
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }


    purchase_hungary_cas = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = CAS1
                    has_tech = iw_small_airframe
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_cas }
                #HUN = { set_country_flag = exporting_cas }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = CAS_equipment_1
                    amount = 15
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = small_plane_cas_airframe
                    amount = 15
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }

    purchase_hungary_tac_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 2
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 2
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = tactical_bomber1
                    has_tech = iw_medium_airframe
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_air
        cost = 20

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_bombers }
                #HUN = { set_country_flag = exporting_bombers }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 2 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 2
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = tac_bomber_equipment_0
                    amount = 15
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = medium_plane_airframe_1
                    amount = 15
                    producer = HUN
                    variant_name = "B-18"
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -2 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 20
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -2
                #}
            }
        }
    }
    purchase_hungary_heavy_bombers = {
        available = {
            IF = {
                limit = { tag = ETH }
                OR = {
                    NOT = { has_idea = ETH_on_our_own_idea }
                    has_completed_focus = ETH_arms_purchases 
                }
            }
            convoy_threat < 0.5
            IF = {
                limit = { tag = BUL }
                NOT = { has_idea = BUL_army_restrictions }
            }
            #is_subject = no
            OR = {
                is_subject = no
                is_subject_of = HUN
            }
            IF = {
                limit = { tag = HUN }
                NOT = { has_idea = HUN_treaty_of_triannon }
            }
            IF = {
                limit = { tag = SPR }
                NOT = { has_idea = SPR_military_disloyalty }
            }
            has_equipment = {
                train_equipment > 4
            }
            NOT = { HUN = { has_idea = closed_economy }}
            HUN = {
                num_of_factories > 25
                OR = {
                    IF = {
                        Limit = { HUN = { NOT = { is_major = no } } }
                        has_war_with_major = no #has_war = no
                    }
                    else = {
                        has_war = no
                    }
                    has_war_together_with = ROOT
                }
            }
            num_of_civilian_factories_available_for_projects > 1
            HUN = {
                 has_opinion = {
                target = ROOT
                value > 19
                }
                #has_tech = 
            }
        }
        #ai_will_do = {
        #    factor = 0.1
        #    modifier = {
        #        OR = {
        #            num_of_civilian_factories < 5
        #            stockpile_ratio = { 
        #                archetype = anti_air_equipment
        #                ratio > 3
        #            }
        #        }
        #        factor = 0
        #    }
        #    modifier = {
        #        has_war = yes
        #        factor = 10
        #    }
        #}
        modifier = {
            civilian_factory_use = 3
        }
        days_remove = 120
        visible = {
            HUN = { 
                OR = {
                    has_tech = strategic_bomber1
                    has_tech = iw_large_airframe
                }
            }
            HUN = { NOT = { has_capitulated = yes }}
            has_country_flag = open_hungary_menu
            NOT = { 
                tag = HUN
            }
            HUN = { NOT = { has_capitulated = yes }}
            NOT = { 
                has_war_with = HUN
            }
            country_exists = HUN
        }
        icon = generic_air
        cost = 25

        complete_effect = {
            hidden_effect = {
                #HUN = { activate_decision = exporting_heavy_bombers }
                #HUN = { set_country_flag = exporting_heavy_bombers }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = 3 }
                add_to_variable = { IAM_industrial_capacity_factory = -0.03 }
                #add_ideas = diverted_production
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = 3
                #}
                add_opinion_modifier = {
                    target = ROOT
                    modifier = BUL_bought_guns
                }
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_sold_guns
            }
            add_opinion_modifier = {
                target = HUN
                modifier = BUL_arms_trade
            }
        }
        remove_effect = {
            IF = {
                limit = {
                    NOT = { has_dlc = "By Blood Alone" }
                }
                add_equipment_to_stockpile = { 
                    type = strat_bomber_equipment_1
                    amount = 15
                    producer = HUN
                }
            }
            else = {
                add_equipment_to_stockpile = { 
                    type = large_plane_airframe
                    amount = 15
                    producer = HUN
                }
            }
            HUN = {
                add_to_variable = { IAM_industrial_factory_donations = -3 }
                add_to_variable = { IAM_industrial_capacity_factory = 0.03 }
                #remove_ideas = diverted_production
                add_political_power = 25
                #add_offsite_building = {
                #    type = industrial_complex
                #    level = -3
                #}
            }
        }
    }
#Other
    foreign_advisors = {

        available = {
            num_of_factories < 49
        }

        fire_only_once = yes

        visible = {
            always = yes
        }
        fire_only_once = yes
        cost = 200
        icon = hol_draw_up_staff_plans

        complete_effect = {
            army_experience = 5
            add_ideas = foreign_advisors
        }
    }

    purchase_convoys = {

        available = {
            #num_of_factories < 49
            #OR = {
            #    has_country_flag = germany_said_yes
            #    has_country_flag = france_said_yes
            #    has_country_flag = america_said_yes
            #    has_country_flag = italy_said_yes
            #    has_country_flag = sweden_said_yes
            #    has_country_flag = england_said_yes
            #}
        }

        fire_only_once = yes

        visible = {
            always = no
        }
        fire_only_once = yes
        cost = 20
        icon = generic_merge_plant_ship

        complete_effect = {
            add_equipment_to_stockpile = { 
                type = convoy
                amount = 24
                producer = ROOT
            }            
        }
    }

    purchase_obsolete_hulls = {

        available = {
            num_of_factories < 49
            #OR = {
            #    has_country_flag = germany_said_yes
            #    has_country_flag = france_said_yes
            #    has_country_flag = america_said_yes
            #    has_country_flag = italy_said_yes
            #    has_country_flag = sweden_said_yes
            #}
        }

        fire_only_once = yes

        visible = {
            always = yes
        }
        fire_only_once = yes
        cost = 25
        icon = generic_merge_plant_ship

        complete_effect = {
            navy_experience = 5
            set_technology = { pre_dreadnoughts = 1 popup = yes }
            set_technology = { coastal_defense_ships = 1 popup = yes }
        }
    }

    refit_tanks = {

        available = {
            has_tech = gwtank
            has_tech = basic_light_tank_chassis
        }

        ai_will_do = {
            factor = 1
            modifier = {
                date > 1938.01.01
                factor = 10
            }
        }

        fire_only_once = yes

        visible = {
            always = no
        }
        fire_only_once = yes
        cost = 20
        icon = generic_tank

        complete_effect = {
            army_experience = -15
            IF = {
                limit = {
                    NOT = { has_dlc = "No Step Back" }
                }
                create_equipment_variant = {
                    name = "Great War Tank Destroyer"
                    type = gw_tank_equipment
                    upgrades = {
                        tank_gun_upgrade = 7
                        tank_armor_upgrade = 0
                        tank_engine_upgrade = 1
                        tank_reliability_upgrade = 4
                    }
                }

                create_equipment_variant = {
                    name = "Early Light Tank 45mm Refit"
                    type = light_tank_chassis_1
                    upgrades = {
                        tank_gun_upgrade = 5
                        tank_armor_upgrade = 0
                        tank_engine_upgrade = 1
                        tank_reliability_upgrade = 2
                    }
                }

                add_tech_bonus = {
                    bonus = 1.0
                    uses = 3
                    name = refit_tanks
                    technology = basic_light_td
                    technology = basic_light_art
                    technology = basic_light_spaa
                }
            }
            Else = {
                create_equipment_variant = {
                    name = "Interwar Light Tank Destroyer"
                    type = light_tank_destroyer_chassis_0
                    parent_version = 0
                    modules = {
                        main_armament_slot = tank_high_velocity_cannon 
                        turret_type_slot = tank_light_one_man_tank_turret
                        suspension_type_slot = tank_bogie_suspension
                        armor_type_slot = tank_riveted_armor
                        engine_type_slot = tank_gasoline_engine
                        special_type_slot_1 = empty
                    }
                    upgrades = {
                        tank_nsb_armor_upgrade = 2
                        tank_nsb_engine_upgrade = 2
                    }
                    obsolete = no 
                    #icon = "GFX_POL_basic_light_tank"
                }
                create_equipment_variant = {
                    name = "Basic Light Tank Destroyer"
                    type = light_tank_destroyer_chassis_1
                    parent_version = 0
                    modules = {
                        main_armament_slot = tank_high_velocity_cannon 
                        turret_type_slot = tank_light_fixed_superstructure_turret
                        suspension_type_slot = tank_bogie_suspension
                        armor_type_slot = tank_riveted_armor
                        engine_type_slot = tank_gasoline_engine
                        special_type_slot_1 = empty
                    }
                    upgrades = {
                        tank_nsb_armor_upgrade = 2
                        tank_nsb_engine_upgrade = 2
                    }
                    obsolete = no 
                    #icon = "GFX_POL_basic_light_tank"
                }            
            }
        }
    }
#
}