###########################
# Bulgarian Events
###########################

add_namespace = bftb_bulgaria_equipment_purchases

#Purchase Artillery
country_event = {
	id = bftb_bulgaria_equipment_purchases.1
	title = bftb_bulgaria_equipment_purchases.1.t
	desc = bftb_bulgaria_equipment_purchases.1.desc
	picture = GFX_report_event_bul_artillery 

	is_triggered_only = yes

	option = { #Artillery
		name = bftb_bulgaria_equipment_purchases.1.a

		ai_chance = {
			base = 15
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = artillery_equipment
	  				ratio < 0.76
	  			}
			}
		}

		set_variable = { BUL_artillery_type = token:artillery_equipment }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.1.a_tt
	}

	option = { #Anti-Air
		name = bftb_bulgaria_equipment_purchases.1.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = anti_air_equipment
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			FROM.FROM = {
				has_tech = interwar_antiair
			}
		}

		set_variable = { BUL_artillery_type = token:anti_air_equipment }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.1.b_tt
	}

	option = { #Anti-Tank
		name = bftb_bulgaria_equipment_purchases.1.c

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = anti_tank_equipment
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			FROM.FROM = {
				has_tech = interwar_antitank
			}
		}

		set_variable = { BUL_artillery_type = token:anti_tank_equipment }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.1.c_tt
	}
}

#Purchase Military Vehicles
country_event = {
	id = bftb_bulgaria_equipment_purchases.2
	title = bftb_bulgaria_equipment_purchases.2.t
	desc = bftb_bulgaria_equipment_purchases.2.desc
	picture = GFX_report_event_generic_truck 

	is_triggered_only = yes

	option = { #Motorized
		name = bftb_bulgaria_equipment_purchases.2.a

		ai_chance = {
			base = 15
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = motorized_equipment
	  				ratio < 0.76
	  			}
			}
		}

		#set_variable = { BUL_vehicle_type = token:motorized_equipment }
		SWI = { set_country_flag = BUL_producing_motorized_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.2.a_tt
	}

	option = { #Mechanized
		name = bftb_bulgaria_equipment_purchases.2.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = mechanized_equipment
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			SWI = {
				has_tech = mechanised_infantry
			}
		}

		#set_variable = { BUL_vehicle_type = token:mechanized_equipment }
		SWI = { set_country_flag = BUL_producing_mechanized_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.2.b_tt
	}

	option = { #Armored Cars
		name = bftb_bulgaria_equipment_purchases.2.c

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = armored_car_equipment
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			SWI = {
				has_tech = armored_car1
			}
		}

		#set_variable = { BUL_vehicle_type = token:armored_car_equipment }
		SWI = { set_country_flag = BUL_producing_armored_car_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.2.c_tt
	}
}

#Purchase Armor
country_event = {
	id = bftb_bulgaria_equipment_purchases.3
	title = bftb_bulgaria_equipment_purchases.3.t
	desc = bftb_bulgaria_equipment_purchases.3.desc
	picture = GFX_report_event_tank_factory 

	is_triggered_only = yes

	option = { #Light Tank
		name = bftb_bulgaria_equipment_purchases.3.a

		ai_chance = {
			base = 15
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = light_tank_chassis
	  				ratio < 0.76
	  			}
			}
		}

		#set_variable = { BUL_armor_type = token:light_tank_chassis }
		SWI = { set_country_flag = BUL_producing_light_armor_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.3.a_tt
	}

	option = { #Medium Tank
		name = bftb_bulgaria_equipment_purchases.3.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = medium_tank_chassis
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			SWI = {
				OR = {
					has_tech = basic_medium_tank
					has_tech = basic_medium_tank_chassis
				}
			}
		}

		#set_variable = { BUL_armor_type = token:medium_tank_equipment }
		SWI = { set_country_flag = BUL_producing_medium_armor_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.3.b_tt
	}

	option = { #Heavy Tank
		name = bftb_bulgaria_equipment_purchases.3.c

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = heavy_tank_chassis
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			FROM.FROM = {
				has_tech = basic_heavy_tank
			}
		}

		#set_variable = { BUL_armor_type = token:heavy_tank_equipment }
		SWI = { set_country_flag = BUL_producing_heavy_armor_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.3.c_tt
	}
}

#Purchase Aircraft
country_event = {
	id = bftb_bulgaria_equipment_purchases.4
	title = bftb_bulgaria_equipment_purchases.4.t
	desc = bftb_bulgaria_equipment_purchases.4.desc
	picture = GFX_report_event_bul_aircraft_repairs

	is_triggered_only = yes

	option = { #Fighters
		name = bftb_bulgaria_equipment_purchases.4.a

		ai_chance = {
			base = 15
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = fighter_equipment
	  				ratio < 0.76
	  			}
			}
		}

		set_variable = { BUL_aircraft_type = token:fighter_equipment }
		FROM.FROM = { set_country_flag = BUL_producing_fighters_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.4.a_tt
	}

	option = { #Naval Bombers
		name = bftb_bulgaria_equipment_purchases.4.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = nav_bomber_equipment
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			FROM.FROM = {
				has_tech = naval_bomber1
			}
		}

		set_variable = { BUL_aircraft_type = token:nav_bomber_equipment }
		FROM.FROM = { set_country_flag = BUL_producing_naval_bombers_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.4.b_tt
	}

	option = { #Tactical Bombers
		name = bftb_bulgaria_equipment_purchases.4.c

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				stockpile_ratio = { 
	  				archetype = tac_bomber_equipment
	  				ratio < 0.76
	  			}
			}
		}

		trigger = {
			FROM.FROM = {
				has_tech = early_bomber
			}
		}

		set_variable = { BUL_aircraft_type = token:tac_bomber_equipment }
		FROM.FROM = { set_country_flag = BUL_producing_tactical_bombers_for_bulgaria_flag }
		custom_effect_tooltip = bftb_bulgaria_equipment_purchases.4.c_tt
	}
}