ai_sold_extra_guns = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        is_major = yes
        num_of_military_factories > 25
        has_equipment = { infantry_equipment > 10000 }
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_min_for_sale
		id = infantry
		value = 8000
    }
}
ai_sold_extra_big_guns = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        is_major = yes
        num_of_military_factories > 25
        has_equipment = { artillery_equipment > 3000 }
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_min_for_sale
		id = artillery
		value = 2000
    }
}

#大国增加出口
ai_we_shall_EXPORT_equipments = {
    enable = {
        has_war = no
        num_of_military_factories > 40
    }
    abort_when_not_enabled = yes
         ai_strategy = {
		type = equipment_market_for_sale_factor
		id = infantry
		value = 100
	}
        ai_strategy = {
		type = equipment_market_for_sale_factor
		id = support
		value = 50
	}
	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = artillery
		value = 100
	}
	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = armor
		value = 50
	}
}
ai_we_shall_preserve_equipments = {
    enable = {
        has_war = yes
        num_of_military_factories < 25
    }
     abort_when_not_enabled = yes
         ai_strategy = {
		type = equipment_market_for_sale_factor
		id = infantry
		value = -99999
	}
	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = support
		value = -99999
	}
	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = artillery
		value = -99999
	}
	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = armor
		value = -99999
	}
}
ai_we_need_more_uesfull_equipments = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        always = yes
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_for_sale_factor
		id = convoy
		value = -99999
    }
    ai_strategy = {
		type = equipment_market_for_sale_factor
		id = train
		value = -99999
    }
    ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = motorized
		value = 800
    }
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = convoy
		value = -99999
    }
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = light_tank_chassis
		value = -99999
    }
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = motorized_equipment
		value = 100
    }
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = heavy_tank_chassis
		value = -99999
    }
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = modern_tank_chassis
		value = -99999
    }
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = train_equipment
		value = -99999
    }
}
ai_we_shall_import_more_arms_due_to_our_poor_military_industry = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        num_of_military_factories < 25 #25军工大概可以自给自足
        or = { has_war = yes manpower_per_military_factory > 50000 } #平均一个工厂对应多少预备役，这个代码说实话作用不大
        or = { has_equipment = { infantry_equipment < 0 }  #如果我们缺乏如下任意装备的数量超过设定阈值
             has_equipment = { artillery_equipment < -300 }
             has_equipment = { support_equipment < -500 }
             has_equipment = { medium_tank_chassis < -500 }
             has_equipment = { medium_tank_flame_chassis < -1000 }
             has_equipment = { anti_air_equipment < -500 }
             has_equipment = { anti_tank_equipment < -500 }
		 }
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_spend_factories #我们要拿更多的民工去买装备
		value = 999
    }
}
ai_we_dont_need_foreign_rubbish_equipments = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        or = { tag = SOV tag = 	GER  }
        num_of_military_factories > 27
        date < 1941.6.1
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_spend_factories
		value = -99999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = convoy
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = infantry_equipment
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = artillery_equipment
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = anti_tank_equipment
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = anti_air_equipment
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = motorized_equipment
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = light_tank_chassis
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = medium_tank_chassis
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = heavy_tank_chassis
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = modern_tank_chassis
		value = -999999
	}
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = train_equipment
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = small_plane_airframe
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = medium_plane_airframe
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = large_plane_airframe
		value = -999999
	}
}
#缺啥买啥
ai_we_need_guns = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        has_equipment = { infantry_equipment < -3000 }
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = infantry_equipment
		value = 3000
    }
}
ai_we_need_pao = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
       has_equipment = { artillery_equipment < -500 }
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = artillery_equipment
		value = 500
    }
}
ai_we_need_tanks = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        has_equipment = { medium_tank_chassis < -200 }
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = medium_tank_chassis
		value = 200
    }
}
ai_we_dont_need_plane_early = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        date < 1939.8.1
        not = { tag = CHI }
    }
    abort_when_not_enabled = yes
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = small_plane_airframe
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = small_plane_cas_airframe
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = medium_plane_airframe
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = medium_plane_fighter_airframe
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = medium_plane_scout_plane_airframe
		value = -999999
	}
        ai_strategy = {
		type = equipment_market_buying_threshold
		id = large_plane_airframe
		value = -999999
	}
}
ai_we_need_plane_later = {
    allowed = {
        has_dlc = "Arms Against Tyranny"
    }
    enable = {
        has_equipment = { small_plane_airframe < -100 }
        date > 1939.8.1
    }
    abort_when_not_enabled = yes
    ai_strategy = {
		type = equipment_market_buying_threshold
		id = small_plane_airframe
		value = 100
    }
}
