﻿###########################
# Yugoslavian Events
###########################

add_namespace = DOD_yugoslavia


# Yugoslavia joins axis without solving Anti-German military - coup event
country_event = {
	id = DOD_yugoslavia.1
	title = DOD_yugoslavia.1.t
	desc = DOD_yugoslavia.1.desc
	picture = GFX_report_event_yugoslavian_king_peter
	
	fire_only_once = yes

	trigger = {
		tag = YUG
		is_in_faction_with = GER
		has_idea = anti_german_military
		GER = {
			has_government = fascism
			is_faction_leader = yes
		}
		NOT = { has_country_flag = has_already_decided_yugo_coup_flag }
	}

	mean_time_to_happen = { days = 2 }
	
	immediate = {
		hidden_effect = {
			set_country_flag = has_already_decided_yugo_coup_flag
		}
	}
	
	option = { #welp
		name = DOD_yugoslavia.1.a
		ai_chance = {
			factor = 70
			modifier = {
				has_war_with = ENG
				factor = 0
			}
		}
		IF = {
			limit = { 
				NOT = {
					has_country_leader = {
						ruling_only = yes
						character = YUG_peter_ii
					}
				}
			}
			retire_country_leader = yes
		}
		if = {
			limit = {
				date < 1941.09.06
			}
			custom_effect_tooltip = DOD_yugoslavia.1.a.tt
			
			hidden_effect = {
				YUG_peter_ii = {
					promote_character = { ideology = despotism }
					promote_character = { ideology = conservatism }
				}
				retire_character = YUG_prince_paul
				retire_character = YUG_milan_grol
			}
		}
		else = {
			custom_effect_tooltip = DOD_yugoslavia.1.a.tt
			swap_ruler_traits = { remove = underage_monarch add = legitimate_heir }
			
			hidden_effect = {
				YUG_peter_ii = {
					promote_character = { ideology = despotism }
					promote_character = { ideology = conservatism }
				}
				retire_character = YUG_prince_paul
				retire_character = YUG_milan_grol
			}
			set_party_name = { 
				ideology = neutrality 
				long_name = YUG_royal_party
				name = YUG_royal_party
			}
			hidden_effect = {
				YUG_peter_ii = {
					set_portraits = {
						civilian = {
					    	large="GFX_portrait_yugoslavia_peter_ii_old"
						}
					}
				}
				if = {
					limit = {
						has_government = neutrality
					}
					remove_trait = {
						character = YUG_peter_ii
						ideology = conservatism
						trait = underage_monarch
					}
					add_trait = {
						character = YUG_peter_ii
						ideology = conservatism
						trait = legitimate_heir
					}
				}
				if = {
					limit = {
						has_government = democratic
					}
					remove_trait = {
						character = YUG_peter_ii
						ideology = despotism
						trait = underage_monarch
					}
					add_trait = {
						character = YUG_peter_ii
						ideology = despotism
						trait = legitimate_heir
					}
				}
				set_country_flag = peter_is_of_age
			}
		}
		GER = { 
			country_event = {
				id = DOD_yugoslavia.2
				hours = 4
				random_hours = 6
			}	
		}
		custom_effect_tooltip = generic_skip_one_line_tt
		if = {
			limit = {
				is_in_faction_with = GER
			}
			GER = { remove_from_faction = YUG }
		}
		if = {
			limit = {
				is_puppet_of = GER
			}
			GER = {
				set_autonomy = {
					target = YUG
					autonomy_state = autonomy_free
				}
			}
		}
		if = {
			limit = {
				has_government = fascism
			}
			set_politics = { 
				ruling_party = neutrality 
				elections_allowed = no 
			}
			add_popularity = { 
				ideology = neutrality 
				popularity = 0.5 
			}
			set_party_name = { 
				ideology = neutrality 
				long_name = YUG_royal_party 
				name = YUG_royal_party 
			}
		}

	}
	option = { #resistance to the coup, call on Germans for support
		name = DOD_yugoslavia.1.b
		ai_chance = {
			factor = 30
		}	

		GER = { 
			country_event = {
				id = DOD_yugoslavia.3
				hours = 4
				random_hours = 6
			}	
		}
		YUG_start_peters_coup = yes

	}
}

# Yugoslavian coup event - Yugoslavia has rolled over, event for Germany to intervene
country_event = {
	id = DOD_yugoslavia.2
	title = DOD_yugoslavia.2.t
	desc = DOD_yugoslavia.2.desc
	picture = GFX_report_event_military_planning
	
	is_triggered_only = yes
	
	option = { # invasion!
		name = DOD_yugoslavia.2.a	

		create_wargoal = {
			type = annex_everything
			target = YUG
		}

		IF = {
			limit = {
				CRO = { 
					exists = yes 
					is_subject_of = YUG
				}
				YUG = { 
					NOT = { 
						has_completed_focus = YUG_towards_independence 
					} 
				}
			}
			puppet = CRO
		}

		# Claiming German Slovenia
		102 = {
			add_claim_by = ROOT
		}

		custom_effect_tooltip = generic_skip_one_line_tt

		# Claiming Serbia proper for Protection under the Reich 
		107 = {
			add_claim_by = ROOT
		}
		108 = {
			add_claim_by = ROOT
		}

	}
}

# Yugoslavian coup event - Yugoslavian government resists the coup, Germany comes to the rescue...or not
country_event = {
	id = DOD_yugoslavia.3
	title = DOD_yugoslavia.2.t
	desc = DOD_yugoslavia.3.desc
	picture = GFX_report_event_military_planning
	
	is_triggered_only = yes
	
	option = { #invasion!
		name = DOD_yugoslavia.3.a
		ai_chance = {
			factor = 70
		}

		create_wargoal = {
			type = annex_everything
			target = YUG
		}

		# Claiming German Slovenia
		102 = {
			add_claim_by = ROOT
		}

		custom_effect_tooltip = generic_skip_one_line_tt

		# Claiming Serbia proper for Protection under the Reich 
		107 = {
			add_claim_by = ROOT
		}
		108 = {
			add_claim_by = ROOT
		}

	}

	option = { #rescue
		name = DOD_yugoslavia.3.b	
		ai_chance = {
			factor = 30
		}

		add_to_faction = YUG

	}
}

# Yugoslavian independence war(s) - event for YUG
country_event = {
	id = DOD_yugoslavia.10
	title = DOD_yugoslavia.10.t
	desc = DOD_yugoslavia.10.desc
	picture = GFX_report_event_yugoslavia_partisans
	
	trigger = {
		original_tag = YUG
		OR = {
			has_idea = YUG_idea_croatian_opposition
			AND = {
				is_ai = yes 
				has_idea = YUG_idea_croats_suppressed
			}
		}
		any_country = {
			original_tag = GER
			has_government = fascism
			has_war_with = YUG
		}
		OR = {
			AND = {
				CRO = { exists = yes }
				CRO = { is_subject_of = YUG }
			}
			109 = { is_owned_and_controlled_by = YUG }
			103 = { is_owned_and_controlled_by = YUG }
			163 = { is_owned_and_controlled_by = YUG }
			852 = { is_owned_and_controlled_by = YUG }
		}
	}
	
	mean_time_to_happen = {
		days = 2
	}
	
	fire_only_once = yes #would be funny though

	option = {
		name = DOD_yugoslavia.10.a
		ai_chance = {
			base = 100
		}	
		IF = {
			limit = {
				CRO = {
					exists = yes
					is_subject_of = YUG
				}
			}
			set_autonomy = { target = CRO autonomy_state = autonomy_free }
			CRO = {
				declare_war_on = {
					target = YUG
					type = annex_everything
				}
			}
		}
		IF = { #if Montenegro exists, they also join
			limit = {
				MNT = {
					exists = yes
					is_subject_of = YUG
				}
			}
			set_autonomy = { target = MNT autonomy_state = autonomy_free }
			MNT = {
				declare_war_on = {
					target = YUG
					type = annex_everything
				}
			}
		}
		IF = {
			limit = {
				CRO = {
					exists = no
				}
			}
			if = {
				limit = { 109 = { is_owned_and_controlled_by = YUG } }
				CRO = { transfer_state = 109 }
			}
			IF = {
				limit = { 103 = { is_owned_and_controlled_by = YUG } }
				CRO = { transfer_state = 103 }
			}
			IF = {
				limit = { 163 = { is_owned_and_controlled_by = YUG } }
				CRO = { transfer_state = 163 }
			}
			IF = {
				limit = { 852 = { is_owned_and_controlled_by = YUG } }
				CRO = { transfer_state = 852 }
			}
			hidden_effect = {
				104 =  {
					add_claim_by = CRO
				}
				804 =  {
					add_claim_by = CRO
				}

				IF = {
					limit = {
						CRO = {
							capital_scope = {
								NOT = {
									is_in_array = {
										array = AUS.expansion_targets
										value = THIS
									}
								}
							}
						}
					}

					CRO = {
						capital_scope = {
							add_to_array = {
								array = AUS.expansion_targets
								value = THIS
							}
						}
					}

					IF = {
						limit = {
							SLV = {
								capital_scope = {
									NOT = {
										is_in_array = {
											array = AUS.expansion_targets
											value = THIS
										}
									}
								}
							}
						}

						YUG = {
							capital_scope = {
								remove_from_array = {
									array = AUS.expansion_targets
									value = THIS
								}
								set_state_flag = AUS_no_longer_expansion_target
							} 
						}
						
					}
				}
				
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			CRO = {
				declare_war_on = {
					target = YUG
					type = annex_everything
				}
				custom_effect_tooltip = YUG_CRO_independence_war_troops_tt
				hidden_effect = {
					load_oob = "CRO_YUG_independence"
				}
			}
		}
	}
	# Play as Croatia
	option = { 
		name = DOD_yugoslavia.10.b
		ai_chance = {
			base = 0
		}	
		
		IF = {
			limit = {
				CRO = {
					exists = yes
					is_subject_of = YUG
				}
			}
			set_autonomy = { target = CRO autonomy_state = autonomy_free }
			CRO = {
				declare_war_on = {
					target = YUG
					type = annex_everything
				}
			}
		}

		IF = { #if Montenegro exists, they also join
			limit = {
				MNT = {
					exists = yes
					is_subject_of = YUG
				}
			}
			set_autonomy = { target = MNT autonomy_state = autonomy_free }
			MNT = {
				declare_war_on = {
					target = YUG
					type = annex_everything
				}
			}
		}

		IF = {
			limit = {
				CRO = {
					exists = no
				}
				109 = { is_owned_and_controlled_by = YUG }
			}
			CRO = { transfer_state = 109 }
			IF = {
				limit = {
					103 = { is_owned_and_controlled_by = YUG }
				}
				CRO = { transfer_state = 103 }
			}
			IF = {
				limit = {
					163 = { is_owned_and_controlled_by = YUG }
				}
				CRO = { transfer_state = 163 }
			}
			IF = {
				limit = {
					852 = { is_owned_and_controlled_by = YUG }
				}
				CRO = { transfer_state = 852 }
			}
			hidden_effect = {
				104 =  {
					add_claim_by = CRO
				}
				804 =  {
					add_claim_by = CRO
				}
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			custom_effect_tooltip = warning_we_will_change_to_this_country_tt

			custom_effect_tooltip = generic_skip_one_line_tt

			CRO = {
				declare_war_on = {
					target = YUG
					type = annex_everything
				}
				custom_effect_tooltip = YUG_CRO_independence_war_troops_tt
				hidden_effect = {
					load_oob = "CRO_YUG_independence"

					IF = {
						limit = {
							CRO = {
								capital_scope = {
									NOT = {
										is_in_array = {
											array = AUS.expansion_targets
											value = THIS
										}
									}
								}
							}
						}

						CRO = {
							capital_scope = {
								add_to_array = {
									array = AUS.expansion_targets
									value = THIS
								}
							}
						}

						IF = {
							limit = {
								SLV = {
									capital_scope = {
										NOT = {
											is_in_array = {
												array = AUS.expansion_targets
												value = THIS
											}
										}
									}
								}
							}

							YUG = {
								capital_scope = {
									remove_from_array = {
										array = AUS.expansion_targets
										value = THIS
									}
								}
							}
						}
					}
				}

				change_tag_from = ROOT

			}

		}

	}
}

#Yugoslavia wants to buy planes - event for GER,FRA,ENG,ITA
country_event = {
	id = DOD_yugoslavia.20
	title = DOD_yugoslavia.20.t
	desc = DOD_yugoslavia.20.desc
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes
	
	option = { # send some fighters
		name = DOD_yugoslavia.20.a
		ai_chance = {
			factor = 70
		}	
		trigger = {
			has_equipment = { small_plane_airframe > 50 }
		}
		send_equipment = {
			target = YUG
			type = small_plane_airframe
			amount = 50
		}
		add_timed_idea = { idea = YUG_air_payment days = 180 }
		YUG = {
			country_event = DOD_yugoslavia.21
		}
	}	
	option = { # send some bombers
		name = DOD_yugoslavia.20.b
		ai_chance = {
			factor = 70
		}
		trigger = {
			has_equipment = { medium_plane_airframe > 25 }
		}
		send_equipment = {
			target = YUG
			type = medium_plane_airframe
			amount = 25
		}	
		add_timed_idea = { idea = YUG_air_payment days = 180 }
		YUG = {
			country_event = DOD_yugoslavia.22
		}
	}

	option = { # divert some fighters from production
		name = DOD_yugoslavia.20.d
		ai_chance = {
			factor = 70
		}	
		trigger = {
			NOT = { has_equipment = { small_plane_airframe > 50 } }
		}
		add_timed_idea = { idea = YUG_air_payment days = 180 }
		add_timed_idea = { idea = YUG_fighter_production_diverted days = 120 }
		YUG = {
			country_event = DOD_yugoslavia.23
		}
	}

	option = { # divert some bombers from production
		name = DOD_yugoslavia.20.e
		ai_chance = {
			factor = 70
		}
		trigger = {
			NOT = { has_equipment = { medium_plane_airframe > 25 } }
		}
		add_timed_idea = { idea = YUG_air_payment days = 180 }
		add_timed_idea = { idea = YUG_bomber_production_diverted days = 120 }
		YUG = {
			country_event = DOD_yugoslavia.24
		}
	}
	option = { # no
		name = DOD_yugoslavia.20.c
		ai_chance = {
			factor = 30
		}	
	}	
		
	
}
#Yugoslavia wants to buy planes - Major nation sells some fighters
country_event = {
	id = DOD_yugoslavia.21
	title = DOD_yugoslavia.21.t
	desc = DOD_yugoslavia.21.desc   
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes
	
	option = { # cool
		name = DOD_yugoslavia.21.a
		ai_chance = {
			factor = 30
		}
		add_opinion_modifier = { target = FROM modifier = YUG_sold_planes}	
	}	
		
	
}

#Yugoslavia wants to buy planes - Major nation sells some bombers
country_event = {
	id = DOD_yugoslavia.22
	title = DOD_yugoslavia.22.t
	desc = DOD_yugoslavia.22.desc
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes
	
	option = { # cool
		name = DOD_yugoslavia.21.a
		ai_chance = {
			factor = 30
		}
		add_opinion_modifier = { target = FROM modifier = YUG_sold_planes}	
	}	
		
	
}
#Yugoslavia wants to buy planes - Major nation sells some fighters
country_event = {
	id = DOD_yugoslavia.23
	title = DOD_yugoslavia.21.t
	desc = DOD_yugoslavia.21.desc   
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes
	
	option = { # cool
		name = DOD_yugoslavia.21.a
		ai_chance = {
			factor = 30
		}
		if = {
			limit = {
				FROM = {
					tag = GER
				}
			}
			if = {
				limit = { 
					GER = { 
						has_tech = early_fighter
						NOT = { has_tech = fighter1 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_0 amount = 50 producer = GER } 
			}
			else_if = {
				limit = { 
					GER = { 
						has_tech = fighter1 
						NOT = { has_tech = fighter2 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_1 amount = 50 producer = GER } 
			}
			else_if = {
				limit = { 
					GER = { 
						has_tech = fighter2 
						NOT = { has_tech = fighter3 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_2 amount = 50 producer = GER } 
			}
			else_if = {
				limit = { 
					GER = { 
						has_tech = fighter3 
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_3 amount = 50 producer = GER } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { fighter_buy_amount = 50 } 
				bba_get_fighter_GER_effect = yes
			}
		} 
		if = {
			limit = {
				FROM = {
					tag = ITA
				}
			}
			if = {
				limit = { 
					ITA= { 
						has_tech = early_fighter
						NOT = { has_tech = fighter1 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_0 amount = 50 producer = ITA } 
			}
			else_if = {
				limit = { 
					ITA = { 
						has_tech = fighter1 
						NOT = { has_tech = fighter2 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_1 amount = 50 producer = ITA } 
			}
			else_if = {
				limit = { 
					ITA = { 
						has_tech = fighter2 
						NOT = { has_tech = fighter3 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_2 amount = 50 producer = ITA } 
			}
			else_if = {
				limit = { 
					ITA = { 
						has_tech = fighter3 
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_3 amount = 50 producer = ITA } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { fighter_buy_amount = 50 } 
				bba_get_fighter_ITA_effect = yes
			}
		}

		if = {
			limit = {
				FROM = {
					tag = FRA
				}
			}
			if = {
				limit = { 
					FRA = { 
						has_tech = early_fighter
						NOT = { has_tech = fighter1 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_0 amount = 50 producer = FRA } 
			}
			else_if = {
				limit = { 
					FRA = { 
						has_tech = fighter1 
						NOT = { has_tech = fighter2 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_1 amount = 50 producer = FRA } 
			}
			else_if = {
				limit = { 
					FRA = { 
						has_tech = fighter2 
						NOT = { has_tech = fighter3 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_2 amount = 50 producer = FRA } 
			}
			else_if = {
				limit = { 
					FRA = { 
						has_tech = fighter3 
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_3 amount = 50 producer = FRA } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { fighter_buy_amount = 50 } 
				bba_get_fighter_FRA_effect = yes
			}
		}

		if = {
			limit = {
				FROM = {
					tag = ENG
				}
			}
			if = {
				limit = { 
					ENG = { 
						has_tech = early_fighter
						NOT = { has_tech = fighter1 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_0 amount = 50 producer = ENG } 
			}
			else_if = {
				limit = { 
					ENG = { 
						has_tech = fighter1 
						NOT = { has_tech = fighter2 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_1 amount = 50 producer = ENG } 
			}
			else_if = {
				limit = { 
					ENG = { 
						has_tech = fighter2 
						NOT = { has_tech = fighter3 }
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_2 amount = 50 producer = ENG } 
			}
			else_if = {
				limit = { 
					ENG = { 
						has_tech = fighter3 
					} 
				}
				add_equipment_to_stockpile = { type = fighter_equipment_3 amount = 50 producer = ENG } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { fighter_buy_amount = 50 } 
				bba_get_fighter_ENG_effect = yes
			}
		}
		add_opinion_modifier = { target = FROM modifier = YUG_sold_planes}	
	}	
		
	
}

#Yugoslavia wants to buy planes - Major nation sells some bombers
country_event = {
	id = DOD_yugoslavia.24
	title = DOD_yugoslavia.22.t
	desc = DOD_yugoslavia.22.desc
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes
	
	option = { # cool
		name = DOD_yugoslavia.21.a
		ai_chance = {
			factor = 30
		}
		if = {
			limit = {
				FROM = {
					tag = GER
				}
			}
			if = {
				limit = { 
					GER = { 
						has_tech = early_bomber 
						NOT = { has_tech = tactical_bomber1 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_0 amount = 25 producer = GER } 
			}
			else_if = {
				limit = { 
					GER = { 
						has_tech = tactical_bomber1 
						NOT = { has_tech = tactical_bomber2 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_1 amount = 25 producer = GER } 
			}
			else_if = {
				limit = { 
					GER = { 
						has_tech = tactical_bomber2 
						NOT = { has_tech = tactical_bomber3 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_2 amount = 25 producer = GER } 
			}
			else_if = {
				limit = { 
					GER = { 
						has_tech = tactical_bomber3 
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_3 amount = 25 producer = GER } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { tac_buy_amount = 25 } 
				bba_get_tac_GER_effect = yes
			}
		}
		if = {
			limit = {
				FROM = {
					tag = ITA
				}
			}
			if = {
				limit = { 
					ITA = { 
						has_tech = early_bomber 
						NOT = { has_tech = tactical_bomber1 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_0 amount = 25 producer = ITA } 
			}
			else_if = {
				limit = { 
					ITA = { 
						has_tech = tactical_bomber1 
						NOT = { has_tech = tactical_bomber2 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_1 amount = 25 producer = ITA } 
			}
			else_if = {
				limit = { 
					ITA = { 
						has_tech = tactical_bomber2 
						NOT = { has_tech = tactical_bomber3 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_2 amount = 25 producer = ITA } 
			}
			else_if = {
				limit = { 
					ITA = { 
						has_tech = tactical_bomber3 
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_3 amount = 25 producer = ITA } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { tac_buy_amount = 25 } 
				bba_get_tac_ITA_effect = yes
			}
		}

		if = {
			limit = {
				FROM = {
					tag = FRA
				}
			}
			if = {
				limit = { 
					FRA = { 
						has_tech = early_bomber 
						NOT = { has_tech = tactical_bomber1 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_0 amount = 25 producer = FRA } 
			}
			else_if = {
				limit = { 
					FRA = { 
						has_tech = tactical_bomber1 
						NOT = { has_tech = tactical_bomber2 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_1 amount = 25 producer = FRA } 
			}
			else_if = {
				limit = { 
					FRA = { 
						has_tech = tactical_bomber2 
						NOT = { has_tech = tactical_bomber3 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_2 amount = 25 producer = FRA } 
			}
			else_if = {
				limit = { 
					FRA = { 
						has_tech = tactical_bomber3 
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_3 amount = 25 producer = FRA } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { tac_buy_amount = 25 } 
				bba_get_tac_FRA_effect = yes
			}
		}

		if = {
			limit = {
				FROM = {
					tag = ENG
				}
			}
			if = {
				limit = { 
					ENG = { 
						has_tech = early_bomber 
						NOT = { has_tech = tactical_bomber1 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_0 amount = 25 producer = ENG } 
			}
			else_if = {
				limit = { 
					ENG = { 
						has_tech = tactical_bomber1 
						NOT = { has_tech = tactical_bomber2 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_1 amount = 25 producer = ENG } 
			}
			else_if = {
				limit = { 
					ENG = { 
						has_tech = tactical_bomber2 
						NOT = { has_tech = tactical_bomber3 }
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_2 amount = 25 producer = ENG } 
			}
			else_if = {
				limit = { 
					ENG = { 
						has_tech = tactical_bomber3 
					} 
				}
				add_equipment_to_stockpile = { type = tac_bomber_equipment_3 amount = 25 producer = ENG } 
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				set_variable = { tac_buy_amount = 25 } 
				bba_get_tac_ENG_effect = yes
			}
		}
		add_opinion_modifier = { target = FROM modifier = YUG_sold_planes}	
	}		
	
}

# Yugoslavia pressured by Germany - after Anschluss - event for GER
country_event = {
	id = DOD_yugoslavia.30
	title = DOD_yugoslavia.30.t
	desc = DOD_yugoslavia.30.desc
	picture = GFX_report_event_german_speech
	
	is_triggered_only = yes
	
	option = { # put the squeeze on them
		name = DOD_yugoslavia.30.a
		ai_chance = {
			base = 70
		}

		YUG = { 
			country_event = {
				id = DOD_yugoslavia.31 
				hours = 6
				random_hours = 12
			}	
			set_country_flag = YUG_GER_pressure_1 #for ai_weights in focus tree
		}
		
	}	
	option = { # not interested
		name = DOD_yugoslavia.30.b
		ai_chance = {
			base = 30
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}
		
	}
		
	
}

#Yugoslavia pressured by Germany - First event - event for YUG
country_event = {
	id = DOD_yugoslavia.31
	title = DOD_yugoslavia.31.t
	desc = DOD_yugoslavia.31.desc
	picture = GFX_report_event_german_speech
	
	is_triggered_only = yes
		
	option = { # not that bad yet
		name = DOD_yugoslavia.31.a
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}

		add_opinion_modifier = {
			target = FROM
			modifier = YUG_GER_pressured_us_annoyed_opm
		}	
		set_country_flag = YUG_stands_up_to_german_pressure_once_flag
		
	}

	option = { # We must keep up good relation with them...
		name = DOD_yugoslavia.31.b
		ai_chance = {
			base = 50
		}
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = YUG_wavering_to_GER_pressure_opm
			}
		}
		add_opinion_modifier = {
			target = FROM
			modifier = YUG_wavering_to_GER_pressure_reverse_opm
		}
			
		set_country_flag = YUG_wavered_to_german_pressure_once_flag
		
	}
		
	
}

# Yugoslavia pressured by Germany - Fate of CZE - event for GER
country_event = {
	id = DOD_yugoslavia.32
	title = DOD_yugoslavia.30.t
	desc = DOD_yugoslavia.32.desc
	picture = GFX_report_event_german_troops
	
	is_triggered_only = yes
	
	option = { # put the squeeze on them
		name = DOD_yugoslavia.32.a
		ai_chance = {
			base = 80
		}

		YUG = { 
			country_event = {
				id = DOD_yugoslavia.33 
				hours = 6
				random_hours = 12
			}	
			set_country_flag = YUG_GER_pressure_2 #for ai_weights
		}
		
	}	
	option = { # not interested
		name = DOD_yugoslavia.32.b
		ai_chance = {
			base = 20
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}
		
	}
		
	
}

#Yugoslavia pressured by Germany - Second event
country_event = {
	id = DOD_yugoslavia.33
	title = DOD_yugoslavia.31.t
	desc = DOD_yugoslavia.33.desc
	picture = GFX_report_event_german_troops
	
	is_triggered_only = yes
		
	option = { # not that bad 
		name = DOD_yugoslavia.33.a
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}

		IF = {
			limit = {
				has_country_flag = YUG_stands_up_to_german_pressure_once_flag
			}
			set_country_flag = YUG_stands_up_to_german_pressure_twice_flag
			clr_country_flag = YUG_stands_up_to_german_pressure_once_flag
		}		
		ELSE_IF = {
			limit = {
				has_country_flag = YUG_wavered_to_german_pressure_once_flag
			}
			set_country_flag = YUG_wavered_to_german_pressure_once_and_stood_up_once_flag
		}
		
	}

	option = { # This is getting serious, we must crack down on anti-German elements immediately!
		name = DOD_yugoslavia.33.b
		ai_chance = {
			base = 50
		}

		add_stability = -0.03

		IF = {
			limit = {
				has_idea = anti_german_military
			}
			remove_ideas = anti_german_military
		}

		add_popularity = {
			ideology = FROM
			popularity = 0.05
		}	

		IF = {
			limit = {
				has_country_flag = YUG_wavered_to_german_pressure_once_flag
			}
			set_country_flag = YUG_wavered_to_german_pressure_twice_flag
			clr_country_flag = YUG_wavered_to_german_pressure_once_flag
		}		
		ELSE_IF = {
			limit = {
				has_country_flag = YUG_stands_up_to_german_pressure_once_flag
			}
			set_country_flag = YUG_wavered_to_german_pressure_once_and_stood_up_once_flag
		}
		
	}
}

# Yugoslavia pressured by Germany - Last Warning - after Fall of France - event for GER
country_event = {
	id = DOD_yugoslavia.34
	title = DOD_yugoslavia.30.t
	desc = DOD_yugoslavia.34.desc
	picture = GFX_report_event_german_troops_paris
	
	mean_time_to_happen = {
		days = 5
	}

	fire_only_once = yes

	trigger = {
		tag = GER
		has_government = fascism
		NOT = {
			has_war_with = YUG
		}
		YUG = {
			is_in_faction = no
		}
		FRA = {
			OR = {
				has_capitulated = yes
				is_subject_of = GER
			}
		}
	}
	
	option = { # put the squeeze on them
		name = DOD_yugoslavia.34.a
		ai_chance = {
			base = 90
		}

		YUG = { 
			country_event = {
				id = DOD_yugoslavia.35
				hours = 6
				random_hours = 12
			}
		}
		
	}	
	option = { # not interested
		name = DOD_yugoslavia.34.b
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}


		
	}
		
	
}

# Yugoslavia pressured by Germany - third event - event for YUG
country_event = {
	id = DOD_yugoslavia.35
	title = DOD_yugoslavia.31.t
	desc = DOD_yugoslavia.35.desc
	picture = GFX_report_event_german_troops_paris
	
	is_triggered_only = yes
		
	option = { # not that bad
		name = DOD_yugoslavia.35.a
		ai_chance = {
			base = 30
		}

		add_political_power = -25

		add_popularity = {
			ideology = FROM
			popularity = 0.05
		}	

		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = YUG_wavering_to_GER_pressure_2_opm
			}
		}
		add_opinion_modifier = {
			target = FROM
			modifier = YUG_wavering_to_GER_pressure_reverse_2_opm
		}
		
	}

	option = { # No, we must not placate them further!
		name = DOD_yugoslavia.35.b
		ai_chance = {
			base = 30
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}

		add_war_support = 0.05

		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = enemy_of_the_reich_opm
			}	
		}
		
	}
		
	
}



# Yugoslavia pressured by Britain - Balkan Strategy - event for ENG
country_event = {
	id = DOD_yugoslavia.40
	title = DOD_yugoslavia.30.t
	desc = DOD_yugoslavia.40.desc
	picture = GFX_report_event_chamberlain_announce
	
	is_triggered_only = yes
	
	option = { # put the squeeze on them
		name = DOD_yugoslavia.40.a
		ai_chance = {
			base = 70
		}

		YUG = { 
			country_event = {
				id = DOD_yugoslavia.41 
				hours = 6
				random_hours = 12
			} 
		}
		
	}	
	option = { # not interested
		name = DOD_yugoslavia.40.b
		ai_chance = {
			base = 30
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}
		
	}
		
	
}

# Yugoslavia pressured by Britain - First event - event for YUG
country_event = {
	id = DOD_yugoslavia.41
	title = DOD_yugoslavia.41.t
	desc = DOD_yugoslavia.41.desc
	picture = GFX_report_event_french_british_officers
	
	is_triggered_only = yes
		
	option = { # not that bad yet
		name = DOD_yugoslavia.41.a
		ai_chance = {
			base = 30
		}

		add_popularity = {
			ideology = FROM
			popularity = 0.05
		}	
		
	}	
}

# Yugoslavia pressured by Britain - Munich - event for ENG
country_event = {
	id = DOD_yugoslavia.42
	title = DOD_yugoslavia.30.t
	desc = DOD_yugoslavia.42.desc
	picture = GFX_report_event_french_british_officers
	
	is_triggered_only = yes
	
	option = { # put the squeeze on them
		name = DOD_yugoslavia.42.a
		ai_chance = {
			base = 70
		}
		YUG = { 
			country_event = {
				id = DOD_yugoslavia.43 
				hours = 6
				random_hours = 12
			} 
		}
		
	}	
	option = { # not interested
		name = DOD_yugoslavia.42.b
		ai_chance = {
			base = 30
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}


		
	}
	
}

# Yugoslavia pressured by Britain - Second event - event for YUG
country_event = {
	id = DOD_yugoslavia.43
	title = DOD_yugoslavia.41.t
	desc = DOD_yugoslavia.43.desc
	picture = GFX_report_event_canadian_soldiers
	
	is_triggered_only = yes
		
	option = { # not that bad yet
		name = DOD_yugoslavia.43.a
		ai_chance = {
			base = 30
		}


		
	}	
}

#Yugoslavia pressured by Britain - late 1940, last warning - event for ENG
country_event = {
	id = DOD_yugoslavia.44
	title = DOD_yugoslavia.30.t
	desc = DOD_yugoslavia.44.desc
	picture = GFX_report_event_french_british_officers
	
	fire_only_once = yes
	
	trigger = {
		tag = ENG
		is_historical_focus_on = no
		has_government = democratic
		has_war_with = GER
		NOT = { has_war_with = YUG }
		NOT = { is_in_faction_with = YUG }
		YUG = { is_in_faction = no }
		YUG = { NOT = { has_war_with = GER } }
		YUG = { exists = yes }
	}

	mean_time_to_happen = { days = 4 }
	
	option = { # put the squeeze on them
		name = DOD_yugoslavia.44.a
		ai_chance = {
			base = 90
		}
		YUG = { 
			country_event = {
				id = DOD_yugoslavia.45  
				hours = 6
				random_hours = 12
			} 
		}
		hidden_effect = { 
			country_event = { 
				id = DOD_yugoslavia.46 
				days = 180 
				random = 672 
			} 
		}
		
	}	
	option = { # not interested
		name = DOD_yugoslavia.44.b
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}



	}
}

#Yugoslavia pressured by Britain - Third event - event for YUG
country_event = {
	id = DOD_yugoslavia.45
	title = DOD_yugoslavia.41.t
	desc = DOD_yugoslavia.45.desc
	picture = GFX_report_event_british_inspect_troops
	
	is_triggered_only = yes
		
	option = { # not that bad yet
		name = DOD_yugoslavia.45.a
		ai_chance = {
			base = 30
		}
		
		custom_effect_tooltip = YUG_if_we_dont_side_with_britain_within_a_year_warning_tt

	}	
}

# Yugoslavia pressured by Britain - war - event for ENG
country_event = {
	id = DOD_yugoslavia.46
	title = DOD_yugoslavia.30.t
	desc = DOD_yugoslavia.46.desc
	picture = GFX_report_event_ast_army
	
	is_triggered_only = yes
	fire_only_once = yes 
	trigger = {
		tag = ENG
		has_government = democratic
		YUG = { is_in_faction = no }
		YUG = { exists = yes }
		has_war_with = GER
	}
	
	option = { # put the squeeze on them
		name = DOD_yugoslavia.46.a
		trigger = { OR = { is_ai = no is_historical_focus_on = no } } #EAI
		ai_chance = {
			factor = 90
			modifier = {  #EOUH
				factor = 0
				has_global_flag = EOUH_active
				OR = {
					any_home_area_neighbor_country = {
						has_war_with = ROOT
					}
					any_of_scopes = {
						array = enemies
						any_home_area_neighbor_country = {
							has_war_with = PREV
							OR = {
								tag = ROOT
								is_ally_with = ROOT
							}
						}
					}
				}
			}
		}

		declare_war_on = {
			target = YUG
			type = puppet_wargoal_focus
		}
		
	}	
	option = { # not interested
		name = DOD_yugoslavia.46.b
		ai_chance = {
			base = 10
		}



	}
}



#fighter competition - initial choice for Yugoslavia
country_event = {
	id = DOD_yugoslavia.150
	title = DOD_hungary.150.t
	desc = DOD_hungary.150.desc 
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# light fighter
		name = DOD_hungary.150.a
		trigger = {
			OR = {
				GER = {
					is_available_fighter_HUN = yes #it says HUN but it is really using ROOT
				}
				FRA = {
					is_available_fighter_HUN = yes
				}
				ITA = {
					is_available_fighter_HUN = yes
				}
				ENG = {
					is_available_fighter_HUN = yes
				}
				USA = {
					is_available_fighter_HUN = yes
				}
			}
		}
		ai_chance = {
			factor = 50
			modifier = {
				has_tech = fighter1
				add = -10
			}
			modifier = {
				has_tech = fighter2
				add = -10
			}
			modifier = {
				has_tech = fighter3
				factor = 0
			}
			modifier = {
				has_tech = basic_small_airframe
				add = -10
			}
			modifier = {
				has_tech = improved_small_airframe
				add = -10
			}
			modifier = {
				has_tech = advanced_small_airframe
				factor = 0
			}
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			country_event = DOD_yugoslavia.151 
		}
		else = {
			country_event = DOD_yugoslavia.1511
		}
		
	}

	option = {# heavy fighter
		name = DOD_hungary.150.b
		trigger = {
			OR = {
				GER = {
					is_available_heavy_fighter_HUN = yes
				}
				FRA = {
					is_available_heavy_fighter_HUN = yes
				}
				ITA = {
					is_available_heavy_fighter_HUN = yes
				}
				ENG = {
					is_available_heavy_fighter_HUN = yes
				}
				USA = {
					is_available_heavy_fighter_HUN = yes
				}
			}
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			country_event = DOD_romania.152
		}
		else = {
			country_event = DOD_romania.1521	
		}
		ai_chance = {
			factor = 50
			modifier = {
				has_tech = heavy_fighter1
				add = -10
			}
			modifier = {
				has_tech = heavy_fighter2
				add = -10
			}
			modifier = {
				has_tech = heavy_fighter3
				factor = 0
			}
			modifier = {
				has_tech = basic_medium_airframe
				add = -10
			}
			modifier = {
				has_tech = improved_medium_airframe
				add = -10
			}
			modifier = {
				has_tech = advanced_medium_airframe
				factor = 0
			}
		}
	}
}

#Fighter competition - Yugoslavia is looking for a light fighter
country_event = {
	id = DOD_yugoslavia.151
	title = DOD_hungary.151.t
	desc = {
		text = DOD_hungary.151.desc_light_fighter
		trigger = {
			NOT = { 
				has_country_flag = GER_fighter_refused
				has_country_flag = ENG_fighter_refused
				has_country_flag = USA_fighter_refused
				has_country_flag = FRA_fighter_refused
				has_country_flag = ITA_fighter_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.151.desc_light_fighter_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_fighter_refused
				has_country_flag = ENG_fighter_refused
				has_country_flag = USA_fighter_refused
				has_country_flag = FRA_fighter_refused
				has_country_flag = ITA_fighter_refused
		 	}
		}
	}
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = fighter1
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = fighter2
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = fighter1}
					YUG = { NOT = { has_tech = fighter1 } }
				}
				AND = {
					GER = { has_tech = fighter2}
					YUG = { NOT = { has_tech = fighter2 } }
				}
				AND = {
					GER = { has_tech = fighter3}
					YUG = { NOT = { has_tech = fighter3 } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_fighter_refused }
		}
		GER = { country_event = DOD_yugoslavia.153 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = fighter1
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = fighter2
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = fighter1}
					YUG = { NOT = { has_tech = fighter1 } }
				}
				AND = {
					ITA = { has_tech = fighter2}
					YUG = { NOT = { has_tech = fighter2 } }
				}
				AND = {
					ITA = { has_tech = fighter3}
					YUG = { NOT = { has_tech = fighter3 } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_fighter_refused }
		}
		ITA = { country_event = DOD_yugoslavia.153 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = fighter1
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = fighter2
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = fighter1}
					YUG = { NOT = { has_tech = fighter1 } }
				}
				AND = {
					FRA = { has_tech = fighter2}
					YUG = { NOT = { has_tech = fighter2 } }
				}
				AND = {
					FRA = { has_tech = fighter3}
					YUG = { NOT = { has_tech = fighter3 } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_fighter_refused }
			
		}
		FRA = { country_event = DOD_yugoslavia.153 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = fighter1
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = fighter2
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = fighter1}
					YUG = { NOT = { has_tech = fighter1 } }
				}
				AND = {
					ENG = { has_tech = fighter2}
					YUG = { NOT = { has_tech = fighter2 } }
				}
				AND = {
					ENG = { has_tech = fighter3}
					YUG = { NOT = { has_tech = fighter3 } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_fighter_refused }
		}
		ENG = { country_event = DOD_yugoslavia.153 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = fighter1
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = fighter2
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = fighter1}
					YUG = { NOT = { has_tech = fighter1 } }
				}
				AND = {
					USA = { has_tech = fighter2}
					YUG = { NOT = { has_tech = fighter2 } }
				}
				AND = {
					USA = { has_tech = fighter3}
					YUG = { NOT = { has_tech = fighter3 } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_fighter_refused }
			NOT = { #to prevent overflow issues
				AND = {
					GER = {
						is_available_fighter_YUG = yes
					}
					FRA = {
						is_available_fighter_YUG = yes
					}
					ITA = {
						is_available_fighter_YUG = yes
					}
					ENG = {
						is_available_fighter_YUG = yes
					}
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.153 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_fighter_refused
				has_country_flag = ITA_fighter_refused
				has_country_flag = ENG_fighter_refused
				has_country_flag = FRA_fighter_refused
				has_country_flag = USA_fighter_refused
			}
		}
		air_experience = 50
	}

}
#Fighter competition - Yugoslavia is looking for a light fighter - BBA version
country_event = {
	id = DOD_yugoslavia.1511
	title = DOD_hungary.151.t
	desc = {
		text = DOD_hungary.151.desc_light_fighter
		trigger = {
			NOT = { 
				has_country_flag = GER_fighter_refused
				has_country_flag = ENG_fighter_refused
				has_country_flag = USA_fighter_refused
				has_country_flag = FRA_fighter_refused
				has_country_flag = ITA_fighter_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.151.desc_light_fighter_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_fighter_refused
				has_country_flag = ENG_fighter_refused
				has_country_flag = USA_fighter_refused
				has_country_flag = FRA_fighter_refused
				has_country_flag = ITA_fighter_refused
		 	}
		}
	}
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					GER = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					GER = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_fighter_refused }
		}
		GER = { country_event = DOD_yugoslavia.153 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					ITA = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					ITA = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_fighter_refused }
		}
		ITA = { country_event = DOD_yugoslavia.153 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					FRA = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					FRA = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_fighter_refused }
			
		}
		FRA = { country_event = DOD_yugoslavia.153 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					ENG = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					ENG = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_fighter_refused }
		}
		ENG = { country_event = DOD_yugoslavia.153 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					USA = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					USA = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_fighter_refused }
			OR = {
				AND = {
					has_country_flag = GER_fighter_refused
					has_country_flag = ITA_fighter_refused
					has_country_flag = ENG_fighter_refused
					has_country_flag = FRA_fighter_refused
				}
				AND = {
					GER = { is_available_fighter_HUN = no }
					ENG = { is_available_fighter_HUN = no }
					FRA = { is_available_fighter_HUN = no }
					ITA = { is_available_fighter_HUN = no }
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.153 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_fighter_refused
				has_country_flag = ITA_fighter_refused
				has_country_flag = ENG_fighter_refused
				has_country_flag = FRA_fighter_refused
				has_country_flag = USA_fighter_refused
			}
		}
		air_experience = 50
	}

}
#Fighter competition - Yugoslavia is looking for a heavy fighter
country_event = {
	id = DOD_yugoslavia.152
	title = DOD_hungary.152.t
	desc = {
		text = DOD_hungary.152.desc_heavy_fighter
		trigger = {
			NOT = { 
				has_country_flag = GER_heavy_fighter_refused
				has_country_flag = ENG_heavy_fighter_refused
				has_country_flag = USA_heavy_fighter_refused
				has_country_flag = FRA_heavy_fighter_refused
				has_country_flag = ITA_heavy_fighter_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.152.desc_heavy_fighter_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_heavy_fighter_refused
				has_country_flag = ENG_heavy_fighter_refused
				has_country_flag = USA_heavy_fighter_refused
				has_country_flag = FRA_heavy_fighter_refused
				has_country_flag = ITA_heavy_fighter_refused
		 	}
		}
	}
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = heavy_fighter1
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = heavy_fighter2
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = heavy_fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = heavy_fighter1}
					YUG = { NOT = { has_tech = heavy_fighter1 } }
				}
				AND = {
					GER = { has_tech = heavy_fighter2}
					YUG = { NOT = { has_tech = heavy_fighter2 } }
				}
				AND = {
					GER = { has_tech = heavy_fighter3}
					YUG = { NOT = { has_tech = heavy_fighter3 } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_heavy_fighter_refused }
		}
		GER = { country_event = DOD_yugoslavia.154 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = heavy_fighter1
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = heavy_fighter2
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = heavy_fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = heavy_fighter1}
					YUG = { NOT = { has_tech = heavy_fighter1 } }
				}
				AND = {
					ITA = { has_tech = heavy_fighter2}
					YUG = { NOT = { has_tech = heavy_fighter2 } }
				}
				AND = {
					ITA = { has_tech = heavy_fighter3}
					YUG = { NOT = { has_tech = heavy_fighter3 } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_heavy_fighter_refused }
		}
		ITA = { country_event = DOD_yugoslavia.154 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = heavy_fighter1
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = heavy_fighter2
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = heavy_fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = heavy_fighter1}
					YUG = { NOT = { has_tech = heavy_fighter1 } }
				}
				AND = {
					FRA = { has_tech = heavy_fighter2}
					YUG = { NOT = { has_tech = heavy_fighter2 } }
				}
				AND = {
					FRA = { has_tech = heavy_fighter3}
					YUG = { NOT = { has_tech = heavy_fighter3 } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_heavy_fighter_refused }
			
		}
		FRA = { country_event = DOD_yugoslavia.154 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = heavy_fighter1
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = heavy_fighter2
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = heavy_fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = heavy_fighter1}
					YUG = { NOT = { has_tech = heavy_fighter1 } }
				}
				AND = {
					ENG = { has_tech = heavy_fighter2}
					YUG = { NOT = { has_tech = heavy_fighter2 } }
				}
				AND = {
					ENG = { has_tech = heavy_fighter3}
					YUG = { NOT = { has_tech = heavy_fighter3 } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_heavy_fighter_refused }
		}
		ENG = { country_event = DOD_yugoslavia.154 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = heavy_fighter1
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = heavy_fighter2
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = heavy_fighter3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = heavy_fighter1}
					YUG = { NOT = { has_tech = heavy_fighter1 } }
				}
				AND = {
					USA = { has_tech = heavy_fighter2}
					YUG = { NOT = { has_tech = heavy_fighter2 } }
				}
				AND = {
					USA = { has_tech = heavy_fighter3}
					YUG = { NOT = { has_tech = heavy_fighter3 } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_heavy_fighter_refused }
			NOT = { #to prevent overflow issues
				AND = {
					GER = {
						is_available_heavy_fighter_YUG = yes
					}
					FRA = {
						is_available_heavy_fighter_YUG = yes
					}
					ITA = {
						is_available_heavy_fighter_YUG = yes
					}
					ENG = {
						is_available_heavy_fighter_YUG = yes
					}
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.154 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_heavy_fighter_refused
				has_country_flag = ITA_heavy_fighter_refused
				has_country_flag = ENG_heavy_fighter_refused
				has_country_flag = FRA_heavy_fighter_refused
				has_country_flag = USA_heavy_fighter_refused
			}
		}
		air_experience = 50
	}

}
#Fighter competition - Romania is looking for a heavy fighter - BBA
country_event = {
	id = DOD_yugoslavia.1521
	title = DOD_hungary.152.t
	desc = {
		text = DOD_hungary.152.desc_heavy_fighter
		trigger = {
			NOT = { 
				has_country_flag = GER_heavy_fighter_refused
				has_country_flag = ENG_heavy_fighter_refused
				has_country_flag = USA_heavy_fighter_refused
				has_country_flag = FRA_heavy_fighter_refused
				has_country_flag = ITA_heavy_fighter_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.152.desc_heavy_fighter_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_heavy_fighter_refused
				has_country_flag = ENG_heavy_fighter_refused
				has_country_flag = USA_heavy_fighter_refused
				has_country_flag = FRA_heavy_fighter_refused
				has_country_flag = ITA_heavy_fighter_refused
		 	}
		}
	}
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = improved_medium_airframe
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					GER = { has_tech = improved_medium_airframe}
					YUG = { NOT = { has_tech = improved_medium_airframe } }
				}
				AND = {
					GER = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_heavy_fighter_refused }
		}
		GER = { country_event = DOD_yugoslavia.154 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = improved_medium_airframe
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					ITA = { has_tech = improved_medium_airframe}
					YUG = { NOT = { has_tech = improved_medium_airframe } }
				}
				AND = {
					ITA = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_heavy_fighter_refused }
		}
		ITA = { country_event = DOD_yugoslavia.154 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = improved_medium_airframe
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					FRA = { has_tech = improved_medium_airframe}
					YUG = { NOT = { has_tech = improved_medium_airframe } }
				}
				AND = {
					FRA = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_heavy_fighter_refused }
			
		}
		FRA = { country_event = DOD_yugoslavia.154 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = improved_medium_airframe
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					ENG = { has_tech = improved_medium_airframe}
					YUG = { NOT = { has_tech = improved_medium_airframe } }
				}
				AND = {
					ENG = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_heavy_fighter_refused }
		}
		ENG = { country_event = DOD_yugoslavia.154 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = improved_medium_airframe
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					USA = { has_tech = improved_medium_airframe}
					YUG = { NOT = { has_tech = improved_medium_airframe } }
				}
				AND = {
					USA = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_heavy_fighter_refused }
			
			AND = { #to prevent overflow issues
				GER = {
					is_available_heavy_fighter_HUN = no
				}
				FRA = {
					is_available_heavy_fighter_HUN = no
				}
				ITA = {
					is_available_heavy_fighter_HUN = no
				}
				ENG = {
					is_available_heavy_fighter_HUN = no
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.154 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_heavy_fighter_refused
				has_country_flag = ITA_heavy_fighter_refused
				has_country_flag = ENG_heavy_fighter_refused
				has_country_flag = FRA_heavy_fighter_refused
				has_country_flag = USA_heavy_fighter_refused
			}
		}
		air_experience = 50
	}
}
#fighter competition - light fighter competition winner gets a choice whether to permit license production
country_event = {
	id = DOD_yugoslavia.153
	title = DOD_hungary.153.t
	desc = DOD_hungary.153.desc 
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# certainly
		name = DOD_hungary.153.a
		ai_chance = {
			factor = 90
			modifier = {
				has_war = yes
				factor = 0.5
			}
		}
		YUG = { country_event = DOD_yugoslavia.155 }
		air_experience = 20
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			if = {
				limit = {
					has_tech = fighter1
					NOT = { has_tech = fighter2 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = fighter_equipment_1
						
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = fighter2
					NOT = { has_tech = fighter3 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = fighter_equipment_2
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = fighter3
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = fighter_equipment_3
					}
					cost_factor = 0
				}
			}
		}
		else = {
			YUG = { set_variable = { fighter_buy_amount = 200 } }
			FROM = { save_event_target_as = license_target }
			if = {
				limit = {
					tag = GER
				}
				YUG = { bba_get_fighter_GER_effect = yes }
			}
			else_if = {
				limit = {
					tag = ENG
				}
				YUG = { bba_get_fighter_ENG_effect = yes }
			}
			else_if = {
				limit = {
					tag = ITA
				}
				YUG = { bba_get_fighter_ITA_effect = yes }
			}
			else_if = {
				limit = {
					tag = FRA
				}
				YUG = { bba_get_fighter_FRA_effect = yes }
			}
			else_if = {
				limit = {
					tag = USA
				}
				YUG = { bba_get_fighter_USA_effect = yes }
			}
			bba_create_fighter_license_effect = yes
		}
	}

	option = {# no
		name = DOD_hungary.153.b
		ai_chance = {
			factor = 10
			modifier = {
				is_in_faction_with = YUG
				factor = 0
			}
		}
		if = {
			limit = { tag = GER }
			YUG = { set_country_flag = GER_fighter_refused }
		}
		if = {
			limit = { tag = ITA }
			YUG = { set_country_flag = ITA_fighter_refused }
		}
		if = {
			limit = { tag = FRA }
			YUG = { set_country_flag = FRA_fighter_refused }
		}
		if = {
			limit = { tag = ENG }
			YUG = { set_country_flag = ENG_fighter_refused }
		}
		if = {
			limit = { tag = USA }
			YUG = { set_country_flag = USA_fighter_refused }
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			YUG = { country_event = DOD_yugoslavia.151 }
		}
		else = {
			YUG = { country_event = DOD_yugoslavia.1511 }
		}
		reverse_add_opinion_modifier = { target = YUG modifier = refused_help }
	}
}

#fighter competition - heavy fighter competition winner gets a choice whether to permit license production
country_event = {
	id = DOD_yugoslavia.154
	title = DOD_hungary.153.t
	desc = DOD_hungary.154.desc 
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# certainly
		name = DOD_hungary.153.a
		ai_chance = {
			factor = 90
			modifier = {
				has_war = yes
				factor = 0.5
			}
		}
		YUG = { country_event = DOD_yugoslavia.155 }
		air_experience = 20
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			if = {
				limit = {
					has_tech = heavy_fighter1
					NOT = { has_tech = heavy_fighter2 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = heavy_fighter_equipment_1
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = heavy_fighter2
					NOT = { has_tech = heavy_fighter3 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = heavy_fighter_equipment_2	
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = heavy_fighter3
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = heavy_fighter_equipment_3
					}
					cost_factor = 0
				}
			}
		}
		else = {
			YUG = { set_variable = { heavy_fighter_buy_amount = 200 } }
			FROM = { save_event_target_as = license_target }
			if = {
				limit = {
					tag = GER
				}
				YUG = { bba_get_heavy_fighter_GER_effect = yes }
				
			}
			else_if = {
				limit = {
					tag = ENG
				}
				YUG = { bba_get_heavy_fighter_ENG_effect = yes }
			}
			else_if = {
				limit = {
					tag = ITA
				}
				YUG = { bba_get_heavy_fighter_ITA_effect = yes }
			}
			else_if = {
				limit = {
					tag = FRA
				}
				YUG = { bba_get_heavy_fighter_FRA_effect = yes }
			}
			else_if = {
				limit = {
					tag = USA
				}
				YUG = { bba_get_heavy_fighter_USA_effect = yes }
			}
			bba_create_heavy_fighter_license_effect = yes
		}
		
	}

	option = {# no
		name = DOD_hungary.153.b
		ai_chance = {
			factor = 10
			modifier = {
				is_in_faction_with = YUG
				factor = 0
			}
		}
		if = {
			limit = { tag = GER }
			YUG = { set_country_flag = GER_heavy_fighter_refused }
		}
		if = {
			limit = { tag = ITA }
			YUG = { set_country_flag = ITA_heavy_fighter_refused }
		}
		if = {
			limit = { tag = FRA }
			YUG = { set_country_flag = FRA_heavy_fighter_refused }
		}
		if = {
			limit = { tag = ENG }
			YUG = { set_country_flag = ENG_heavy_fighter_refused }
		}
		if = {
			limit = { tag = USA }
			YUG = { set_country_flag = USA_heavy_fighter_refused }
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			YUG = { country_event = DOD_yugoslavia.152 }
		}
		else = {
			YUG = { country_event = DOD_yugoslavia.1521 }
		}
		reverse_add_opinion_modifier = { target = YUG modifier = refused_help }
	}
}

#fighter competition - license production approved
country_event = {
	id = DOD_yugoslavia.155
	title = DOD_hungary.155.t
	desc = DOD_hungary.155.desc 
	picture = GFX_report_event_fighters
	
	is_triggered_only = yes

	option = {# neat
		name = DOD_hungary.155.a
		
	}
}


#bomber competition - initial choice for Yugoslavia
country_event = {
	id = DOD_yugoslavia.160
	title = DOD_hungary.160.t
	desc = DOD_hungary.160.desc 
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# CAS
		name = DOD_hungary.160.a
		trigger = {
			OR = {
				GER = {
					is_available_cas_HUN = yes
				}
				FRA = {
					is_available_cas_HUN = yes
				}
				ITA = {
					is_available_cas_HUN = yes
				}
				ENG = {
					is_available_cas_HUN = yes
				}
				USA = {
					is_available_cas_HUN = yes
				}
			}
		}
		ai_chance = {
			factor = 50
			modifier = {
				has_tech = CAS1
				add = -10
			}
			modifier = {
				has_tech = CAS2
				add = -10
			}
			modifier = {
				has_tech = CAS3
				factor = 0
			}
			modifier = {
				has_tech = basic_small_airframe
				add = -10
			}
			modifier = {
				has_tech = improved_small_airframe
				add = -10
			}
			modifier = {
				has_tech = advanced_small_airframe
				factor = 0
			}
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			country_event = DOD_yugoslavia.161 	
		}
		else = {
			country_event = DOD_yugoslavia.1611 		
		}
	}

	option = {# TAC
		name = DOD_hungary.160.b
		trigger = {
			OR = {
				GER = {
					is_available_tac_HUN = yes
				}
				FRA = {
					is_available_tac_HUN = yes
				}
				ITA = {
					is_available_tac_HUN = yes
				}
				ENG = {
					is_available_tac_HUN = yes
				}
				USA = {
					is_available_tac_HUN = yes
				}
			}
		}
		ai_chance = {
			factor = 50
			modifier = {
				has_tech = tactical_bomber1
				add = -10
			}
			modifier = {
				has_tech = tactical_bomber2
				add = -10
			}
			modifier = {
				has_tech = tactical_bomber3
				factor = 0
			}
			modifier = {
				has_tech = basic_medium_airframe
				add = -10
			}
			modifier = {
				has_tech = improved_medium_airframe
				add = -10
			}
			modifier = {
				has_tech = advanced_medium_airframe
				factor = 0
			}
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			country_event = DOD_yugoslavia.162 	
		}
		else = {
			country_event = DOD_yugoslavia.1621 		
		}
	}
}

#Bomber competition - Yugoslavia is looking for a CAS
country_event = {
	id = DOD_yugoslavia.161
	title = DOD_hungary.161.t
	desc = {
		text = DOD_hungary.161.desc_cas
		trigger = {
			NOT = { 
				has_country_flag = GER_CAS_refused
				has_country_flag = ENG_CAS_refused
				has_country_flag = USA_CAS_refused
				has_country_flag = FRA_CAS_refused
				has_country_flag = ITA_CAS_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.161.desc_cas_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_CAS_refused
				has_country_flag = ENG_CAS_refused
				has_country_flag = USA_CAS_refused
				has_country_flag = FRA_CAS_refused
				has_country_flag = ITA_CAS_refused
		 	}
		}
	}
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = CAS1
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = CAS2
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = CAS3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = CAS1}
					YUG = { NOT = { has_tech = CAS1 } }
				}
				AND = {
					GER = { has_tech = CAS2}
					YUG = { NOT = { has_tech = CAS2 } }
				}
				AND = {
					GER = { has_tech = CAS3}
					YUG = { NOT = { has_tech = CAS3 } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_CAS_refused }
		}
		GER = { country_event = DOD_yugoslavia.163 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = CAS1
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = CAS2
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = CAS3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = CAS1}
					YUG = { NOT = { has_tech = CAS1 } }
				}
				AND = {
					ITA = { has_tech = CAS2}
					YUG = { NOT = { has_tech = CAS2 } }
				}
				AND = {
					ITA = { has_tech = CAS3}
					YUG = { NOT = { has_tech = CAS3 } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_CAS_refused }
		}
		ITA = { country_event = DOD_yugoslavia.163 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = CAS1
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = CAS2
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = CAS3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = CAS1}
					YUG = { NOT = { has_tech = CAS1 } }
				}
				AND = {
					FRA = { has_tech = CAS2}
					YUG = { NOT = { has_tech = CAS2 } }
				}
				AND = {
					FRA = { has_tech = CAS3}
					YUG = { NOT = { has_tech = CAS3 } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_CAS_refused }
		}
		FRA = { country_event = DOD_yugoslavia.163 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = CAS1
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = CAS2
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = CAS3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = CAS1}
					YUG = { NOT = { has_tech = CAS1 } }
				}
				AND = {
					ENG = { has_tech = CAS2}
					YUG = { NOT = { has_tech = CAS2 } }
				}
				AND = {
					ENG = { has_tech = CAS3}
					YUG = { NOT = { has_tech = CAS3 } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_CAS_refused }
		}
		ENG = { country_event = DOD_yugoslavia.163 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = CAS1
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = CAS2
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = CAS3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = CAS1}
					YUG = { NOT = { has_tech = CAS1 } }
				}
				AND = {
					USA = { has_tech = CAS2}
					YUG = { NOT = { has_tech = CAS2 } }
				}
				AND = {
					USA = { has_tech = CAS3}
					YUG = { NOT = { has_tech = CAS3 } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_CAS_refused }
			NOT = { #to prevent overflow issues
				AND = {
					GER = {
						is_available_cas_YUG = yes
					}
					FRA = {
						is_available_cas_YUG = yes
					}
					ITA = {
						is_available_cas_YUG = yes
					}
					ENG = {
						is_available_cas_YUG = yes
					}
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.163 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_CAS_refused
				has_country_flag = ITA_CAS_refused
				has_country_flag = ENG_CAS_refused
				has_country_flag = FRA_CAS_refused
				has_country_flag = USA_CAS_refused
			}
		}
		air_experience = 50
	}

}
#Bomber competition - Yugoslavia is looking for a CAS - bba
country_event = {
	id = DOD_yugoslavia.1611
	title = DOD_hungary.161.t
	desc = {
		text = DOD_hungary.161.desc_cas
		trigger = {
			NOT = { 
				has_country_flag = GER_CAS_refused
				has_country_flag = ENG_CAS_refused
				has_country_flag = USA_CAS_refused
				has_country_flag = FRA_CAS_refused
				has_country_flag = ITA_CAS_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.161.desc_cas_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_CAS_refused
				has_country_flag = ENG_CAS_refused
				has_country_flag = USA_CAS_refused
				has_country_flag = FRA_CAS_refused
				has_country_flag = ITA_CAS_refused
		 	}
		}
	}
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					GER = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					GER = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_CAS_refused }
		}
		GER = { country_event = DOD_yugoslavia.163 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					ITA = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					ITA = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_CAS_refused }
		}
		ITA = { country_event = DOD_yugoslavia.163 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					FRA = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					FRA = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_CAS_refused }
		}
		FRA = { country_event = DOD_yugoslavia.163 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					ENG = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					ENG = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_CAS_refused }
		}
		ENG = { country_event = DOD_yugoslavia.163 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = basic_small_airframe
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = improved_small_airframe
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = advanced_small_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = basic_small_airframe}
					YUG = { NOT = { has_tech = basic_small_airframe } }
				}
				AND = {
					USA = { has_tech = improved_small_airframe}
					YUG = { NOT = { has_tech = improved_small_airframe } }
				}
				AND = {
					USA = { has_tech = advanced_small_airframe}
					YUG = { NOT = { has_tech = advanced_small_airframe } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_CAS_refused }
			NOT = { #to prevent overflow issues
				AND = {
					GER = {
						is_available_cas_HUN = yes
					}
					FRA = {
						is_available_cas_HUN = yes
					}
					ITA = {
						is_available_cas_HUN = yes
					}
					ENG = {
						is_available_cas_HUN = yes
					}
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.163 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_CAS_refused
				has_country_flag = ITA_CAS_refused
				has_country_flag = ENG_CAS_refused
				has_country_flag = FRA_CAS_refused
				has_country_flag = USA_CAS_refused
			}
		}
		air_experience = 50
	}

}
#Bomber competition - Yugoslavia is looking for a tacbomber
country_event = {
	id = DOD_yugoslavia.162
	title = DOD_hungary.162.t
	desc = {
		text = DOD_hungary.162.desc_tac
		trigger = {
			NOT = { 
				has_country_flag = GER_tactical_bomber_refused
				has_country_flag = ENG_tactical_bomber_refused
				has_country_flag = USA_tactical_bomber_refused
				has_country_flag = FRA_tactical_bomber_refused
				has_country_flag = ITA_tactical_bomber_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.162.desc_tac_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_tactical_bomber_refused
				has_country_flag = ENG_tactical_bomber_refused
				has_country_flag = USA_tactical_bomber_refused
				has_country_flag = FRA_tactical_bomber_refused
				has_country_flag = ITA_tactical_bomber_refused
		 	}
		}
	}
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = tactical_bomber1
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = tactical_bomber2
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = tactical_bomber3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = tactical_bomber1}
					YUG = { NOT = { has_tech = tactical_bomber1 } }
				}
				AND = {
					GER = { has_tech = tactical_bomber2}
					YUG = { NOT = { has_tech = tactical_bomber2 } }
				}
				AND = {
					GER = { has_tech = tactical_bomber3}
					YUG = { NOT = { has_tech = tactical_bomber3 } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_tactical_bomber_refused }
		}
		GER = { country_event = DOD_yugoslavia.164 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = tactical_bomber1
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = tactical_bomber2
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = tactical_bomber3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = tactical_bomber1}
					YUG = { NOT = { has_tech = tactical_bomber1 } }
				}
				AND = {
					ITA = { has_tech = tactical_bomber2}
					YUG = { NOT = { has_tech = tactical_bomber2 } }
				}
				AND = {
					ITA = { has_tech = tactical_bomber3}
					YUG = { NOT = { has_tech = tactical_bomber3 } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_tactical_bomber_refused }
		}
		ITA = { country_event = DOD_yugoslavia.164 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = tactical_bomber1
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = tactical_bomber2
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = tactical_bomber3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = tactical_bomber1}
					YUG = { NOT = { has_tech = tactical_bomber1 } }
				}
				AND = {
					FRA = { has_tech = tactical_bomber2}
					YUG = { NOT = { has_tech = tactical_bomber2 } }
				}
				AND = {
					FRA = { has_tech = tactical_bomber3}
					YUG = { NOT = { has_tech = tactical_bomber3 } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_tactical_bomber_refused }
		}
		FRA = { country_event = DOD_yugoslavia.164 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = tactical_bomber1
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = tactical_bomber2
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = tactical_bomber3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = tactical_bomber1}
					YUG = { NOT = { has_tech = tactical_bomber1 } }
				}
				AND = {
					ENG = { has_tech = tactical_bomber2}
					YUG = { NOT = { has_tech = tactical_bomber2 } }
				}
				AND = {
					ENG = { has_tech = tactical_bomber3}
					YUG = { NOT = { has_tech = tactical_bomber3 } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_tactical_bomber_refused }
		}
		ENG = { country_event = DOD_yugoslavia.164 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = tactical_bomber1
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = tactical_bomber2
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = tactical_bomber3
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = tactical_bomber1}
					YUG = { NOT = { has_tech = tactical_bomber1 } }
				}
				AND = {
					USA = { has_tech = tactical_bomber2}
					YUG = { NOT = { has_tech = tactical_bomber2 } }
				}
				AND = {
					USA = { has_tech = tactical_bomber3}
					YUG = { NOT = { has_tech = tactical_bomber3 } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_tactical_bomber_refused }
			NOT = { #to prevent overflow issues
				AND = {
					GER = {
						is_available_tac_YUG = yes
					}
					FRA = {
						is_available_tac_YUG = yes
					}
					ITA = {
						is_available_tac_YUG = yes
					}
					ENG = {
						is_available_tac_YUG = yes
					}
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.164 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_fighter_refused
				has_country_flag = ITA_fighter_refused
				has_country_flag = ENG_fighter_refused
				has_country_flag = FRA_fighter_refused
				has_country_flag = USA_fighter_refused
			}
		}
		air_experience = 50
	}

}

#bomber competition - Yugoslavia is looking for a tacbomber - bba
country_event = {
	id = DOD_yugoslavia.1621
	title = DOD_hungary.162.t
	desc = {
		text = DOD_hungary.162.desc_tac
		trigger = {
			NOT = { 
				has_country_flag = GER_tactical_bomber_refused
				has_country_flag = ENG_tactical_bomber_refused
				has_country_flag = USA_tactical_bomber_refused
				has_country_flag = FRA_tactical_bomber_refused
				has_country_flag = ITA_tactical_bomber_refused
			} 
		}
	}
	desc = {
		text = DOD_hungary.162.desc_tac_refused
		trigger = {
			OR = {
		 		has_country_flag = GER_tactical_bomber_refused
				has_country_flag = ENG_tactical_bomber_refused
				has_country_flag = USA_tactical_bomber_refused
				has_country_flag = FRA_tactical_bomber_refused
				has_country_flag = ITA_tactical_bomber_refused
		 	}
		}
	}
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# Select German Plane
		name = DOD_hungary.151.a
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = GER
				factor = 10
			}
			modifier = {
				GER = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				GER = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = improved_medium_airframe 
				}
				add = 10
			}
			modifier = {
				GER = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					GER = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					GER = { has_tech = improved_medium_airframe }
					YUG = { NOT = { has_tech = improved_medium_airframe  } }
				}
				AND = {
					GER = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { has_country_flag = GER_tactical_bomber_refused }
		}
		GER = { country_event = DOD_yugoslavia.164 }	
	}

	option = {# select italian plane
		name = DOD_hungary.151.b
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ITA
				factor = 10
			}
			modifier = {
				ITA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ITA = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = improved_medium_airframe 
				}
				add = 10
			}
			modifier = {
				ITA = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ITA = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					ITA = { has_tech = improved_medium_airframe }
					YUG = { NOT = { has_tech = improved_medium_airframe  } }
				}
				AND = {
					ITA = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = ITA }
			NOT = { has_country_flag = ITA_tactical_bomber_refused }
		}
		ITA = { country_event = DOD_yugoslavia.164 }	
	}

	option = {# select french plane
		name = DOD_hungary.151.c
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = FRA
				factor = 10
			}
			modifier = {
				FRA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				FRA = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = improved_medium_airframe 
				}
				add = 10
			}
			modifier = {
				FRA = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					FRA = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					FRA = { has_tech = improved_medium_airframe }
					YUG = { NOT = { has_tech = improved_medium_airframe  } }
				}
				AND = {
					FRA = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = FRA }
			NOT = { has_country_flag = FRA_tactical_bomber_refused }
		}
		FRA = { country_event = DOD_yugoslavia.164 }	
	}
	option = {# select british plane
		name = DOD_hungary.151.d
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = ENG
				factor = 10
			}
			modifier = {
				ENG = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				ENG = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = improved_medium_airframe 
				}
				add = 10
			}
			modifier = {
				ENG = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					ENG = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					ENG = { has_tech = improved_medium_airframe }
					YUG = { NOT = { has_tech = improved_medium_airframe  } }
				}
				AND = {
					ENG = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { has_country_flag = ENG_tactical_bomber_refused }
		}
		ENG = { country_event = DOD_yugoslavia.164 }	
	}
	option = {# select american plane
		name = DOD_hungary.151.e
		ai_chance = {
			factor = 30
			modifier = {
				is_in_faction_with = USA
				factor = 10
			}
			modifier = {
				USA = { has_government = ROOT }
				factor = 2
			}
			modifier = {
				USA = {
					has_tech = basic_medium_airframe
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = improved_medium_airframe 
				}
				add = 10
			}
			modifier = {
				USA = {
					has_tech = advanced_medium_airframe
				}
				add = 10
			}
		}
		trigger = {
			OR = {
				AND = {
					USA = { has_tech = basic_medium_airframe}
					YUG = { NOT = { has_tech = basic_medium_airframe } }
				}
				AND = {
					USA = { has_tech = improved_medium_airframe }
					YUG = { NOT = { has_tech = improved_medium_airframe  } }
				}
				AND = {
					USA = { has_tech = advanced_medium_airframe}
					YUG = { NOT = { has_tech = advanced_medium_airframe } }
				}
			}
			NOT = { has_war_with = USA }
			NOT = { has_country_flag = USA_tactical_bomber_refused }
			NOT = { #to prevent overflow issues
				AND = {
					GER = {
						is_available_tac_HUN = yes
					}
					FRA = {
						is_available_tac_HUN = yes
					}
					ITA = {
						is_available_tac_HUN = yes
					}
					ENG = {
						is_available_tac_HUN = yes
					}
				}
			}
		}
		USA = { country_event = DOD_yugoslavia.164 }	
	}
	option = {# failsafe
		name = DOD_hungary.151.f	
		trigger = {
			OR = {
				has_country_flag = GER_tactical_bomber_refused
				has_country_flag = ITA_tactical_bomber_refused
				has_country_flag = ENG_tactical_bomber_refused
				has_country_flag = FRA_tactical_bomber_refused
				has_country_flag = USA_tactical_bomber_refused
			}
		}
		air_experience = 50
	}

}

#bomber competition - CAS competition winner gets a choice whether to permit license production
country_event = {
	id = DOD_yugoslavia.163
	title = DOD_hungary.163.t
	desc = DOD_hungary.163.desc 
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# certainly
		name = DOD_hungary.153.a
		ai_chance = {
			factor = 90
			modifier = {
				has_war = yes
				factor = 0.5
			}
		}
		YUG = { country_event = DOD_yugoslavia.165 }
		air_experience = 20
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			if = {
				limit = {
					has_tech = CAS1
					NOT = { has_tech = CAS2 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = CAS_equipment_1
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = CAS2
					NOT = { has_tech = CAS3 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = CAS_equipment_2	
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = CAS3
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = CAS_equipment_3
					}
					cost_factor = 0
				}
			}
		}
		else = {
			YUG = { set_variable = { cas_buy_amount = 200 } }
			FROM = { save_event_target_as = license_target }
			if = {
				limit = {
					tag = GER
				}
				YUG = { bba_get_cas_GER_effect = yes }
			}
			else_if = {
				limit = {
					tag = ENG
				}
				YUG = { bba_get_cas_ENG_effect = yes }
			}
			else_if = {
				limit = {
					tag = ITA
				}
				YUG = { bba_get_cas_ITA_effect = yes }
			}
			else_if = {
				limit = {
					tag = FRA
				}
				YUG = { bba_get_cas_FRA_effect = yes }
			}
			else_if = {
				limit = {
					tag = USA
				}
				YUG = { bba_get_cas_USA_effect = yes }
			}
			bba_create_cas_license_effect = yes
		}
	}

	option = {# no
		name = DOD_hungary.153.b
		ai_chance = {
			factor = 10
			modifier = {
				is_in_faction_with = YUG
				factor = 0
			}
		}
		if = {
			limit = { tag = GER }
			YUG = { set_country_flag = GER_CAS_refused }
		}
		if = {
			limit = { tag = ITA }
			YUG = { set_country_flag = ITA_CAS_refused }
		}
		if = {
			limit = { tag = FRA }
			YUG = { set_country_flag = FRA_CAS_refused }
		}
		if = {
			limit = { tag = ENG }
			YUG = { set_country_flag = ENG_CAS_refused }
		}
		if = {
			limit = { tag = USA }
			YUG = { set_country_flag = USA_CAS_refused }
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			YUG = { country_event = DOD_yugoslavia.161 }
		}
		else = {
			YUG = { country_event = DOD_yugoslavia.1611 }	
		}
		reverse_add_opinion_modifier = { target = YUG modifier = refused_help }
	}
}

#bomber competition - tac bomber competition winner gets a choice whether to permit license production
country_event = {
	id = DOD_yugoslavia.164
	title = DOD_hungary.164.t
	desc = DOD_hungary.164.desc 
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# certainly
		name = DOD_hungary.153.a
		ai_chance = {
			factor = 90
			modifier = {
				has_war = yes
				factor = 0.5
			}
		}
		YUG = { country_event = DOD_yugoslavia.165 }
		air_experience = 20
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			if = {
				limit = {
					has_tech = tactical_bomber1
					NOT = { has_tech = tactical_bomber2 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = tac_bomber_equipment_1
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = tactical_bomber2
					NOT = { has_tech = tactical_bomber3 }
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = tac_bomber_equipment_2	
					}
					cost_factor = 0
				}
			}
			if = {
				limit = {
					has_tech = tactical_bomber3
				}
				create_production_license = {
					target = YUG 
					equipment = {
						type = tac_bomber_equipment_3
					}
					cost_factor = 0
				}
			}
		}
		else = {
			YUG = { set_variable = { tac_buy_amount = 200 } }
			FROM = { save_event_target_as = license_target }
			if = {
				limit = {
					tag = GER
				}
				YUG = { bba_get_tac_GER_effect = yes }
			}
			else_if = {
				limit = {
					tag = ENG
				}
				YUG = { bba_get_tac_ENG_effect = yes }
			}
			else_if = {
				limit = {
					tag = ITA
				}
				YUG = { bba_get_tac_ITA_effect = yes }
			}
			else_if = {
				limit = {
					tag = FRA
				}
				YUG = { bba_get_tac_FRA_effect = yes }
			}
			else_if = {
				limit = {
					tag = USA
				}
				YUG = { bba_get_tac_USA_effect = yes }
			}
			bba_create_tac_license_effect = yes
		}
	}

	option = {# no
		name = DOD_hungary.153.b
		ai_chance = {
			factor = 10
			modifier = {
				is_in_faction_with = YUG
				factor = 0
			}
		}
		if = {
			limit = { tag = GER }
			YUG = { set_country_flag = GER_tactical_bomber_refused }
		}
		if = {
			limit = { tag = ITA }
			YUG = { set_country_flag = ITA_tactical_bomber_refused }
		}
		if = {
			limit = { tag = FRA }
			YUG = { set_country_flag = FRA_tactical_bomber_refused }
		}
		if = {
			limit = { tag = ENG }
			YUG = { set_country_flag = ENG_tactical_bomber_refused }
		}
		if = {
			limit = { tag = USA }
			YUG = { set_country_flag = USA_tactical_bomber_refused }
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "By Blood Alone"
				}
			}
			YUG = { country_event = DOD_yugoslavia.162 }
		}
		else = {
			YUG = { country_event = DOD_yugoslavia.1621 }	
		}
		reverse_add_opinion_modifier = { target = YUG modifier = refused_help }
	}
}

#bomber competition - license production approved
country_event = {
	id = DOD_yugoslavia.165
	title = DOD_hungary.165.t
	desc = DOD_hungary.165.desc 
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# neat
		name = DOD_hungary.165.a
		
	}
}

# Yugoslavia starting Communist propaganda in another nation
country_event = {
	id = DOD_yugoslavia.181
	title = DOD_yugoslavia.181.t
	desc = DOD_yugoslavia.181.d
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# gosh dang commies
		name = worrying
		add_timed_idea = {
			idea = agitated_peasants
			days = 180
		}
		
	}
}

# Pan-Slavic propaganda
country_event = {
	id = DOD_yugoslavia.182
	title = DOD_yugoslavia.182.t
	desc = DOD_yugoslavia.182.d
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {# gosh dang commies
		name = worrying
		add_timed_idea = {
			idea = pan_slavic_propaganda
			days = 70
		}
		add_to_variable = {
			var = yug_additional_communist_support
			value = 0.05
		}
		
	}
}

# Pan-Slavic militants
country_event = {
	id = DOD_yugoslavia.183
	title = DOD_yugoslavia.183.t
	desc = DOD_yugoslavia.183.d
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes

	option = {
		name = DOD_yugoslavia.183.a
		add_timed_idea = {
			idea = armed_communist_militants
			days = 180
		}
		add_to_variable = {
			var = yug_additional_communist_support
			value = 0.1
		}
		set_variable = {
			var = yug_total_com_size
			value = party_popularity@communism
		}
		add_to_variable = {
			var = yug_total_com_size
			value = yug_additional_communist_support
		}
	}
}

# Communist civil war
country_event = {
	id = DOD_yugoslavia.184
	title = DOD_yugoslavia.184.t
	desc = DOD_yugoslavia.184.d
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes
	
	immediate = {
		set_variable = {
			var = yug_total_com_size
			value = party_popularity@communism
		}
		add_to_variable = {
			var = yug_total_com_size
			value = yug_additional_communist_support
		}
	}

	option = {
		name = DOD_yugoslavia.184.a
		trigger = {
			num_of_controlled_states > 1
		}
		ai_chance = { 
			factor = 100
		}
		set_country_flag = had_yugo_civil_war_flag
		start_civil_war = {
			ideology = communism
			size = yug_total_com_size
		}
		hidden_effect = {
			if = {
				limit = {
					YUG = { is_faction_leader = yes }
					any_other_country = {
						NOT = { tag = YUG }
						NOT = { original_tag = ROOT }
						has_war_with = ROOT
					}
				}
				random_country = {
					limit = {
						original_tag = ROOT
						has_war_with = ROOT
					}
					YUG = { add_to_faction = PREV }
				}
			}
		}
	}

	option = {
		name = DOD_yugoslavia.184.b
		ai_chance = { 
			factor = 0
		}
		set_politics = {
			ruling_party = communism
			elections_allowed = no
		}
		add_popularity = {
			ideology = communism 
			popularity = yug_additional_communist_support
		}
		hidden_effect = {
			if = {
				limit = {
					original_tag = BUL
				}
				set_cosmetic_tag = YUG_puppet_1
			}
			if = {
				limit = {
					original_tag = ALB
				}
				set_cosmetic_tag = YUG_puppet_2
			}
			if = {
				limit = {
					original_tag = GRE
				}
				set_cosmetic_tag = YUG_puppet_3
			}
			if = {
				limit = {
					original_tag = ROM
				}
				set_cosmetic_tag = YUG_puppet_4
			}
			if = {
				limit = {
					original_tag = HUN
				}
				set_cosmetic_tag = YUG_puppet_5
			}
			if = {
				limit = {
					original_tag = TUR
				}
				set_cosmetic_tag = YUG_puppet_6
			}
		}
	}
}

#Age King Peter after a few years
country_event = {
	id = DOD_yugoslavia.19
	title = DOD_yugoslavia.19.t
	desc = DOD_yugoslavia.19.desc
	picture = GFX_report_event_yugoslavian_king_peter

	trigger = {
		tag = YUG
		has_country_leader = {
		    character = YUG_peter_ii
		    ruling_only = yes
		}
		NOT = { has_country_flag = peter_is_of_age }
		date > 1941.09.06
	}

	fire_only_once = yes

	option = {
		name = DOD_yugoslavia.19.a
		swap_ruler_traits = { remove = underage_monarch add = legitimate_heir }	
		set_party_name = { 
			ideology = neutrality 
			long_name = YUG_royal_party
			name = YUG_royal_party
		}
		hidden_effect = {
			YUG_peter_ii = {
				set_portraits = {
					civilian = {
				    	large="GFX_portrait_yugoslavia_peter_ii_old"
					}
				}
			}
			if = {
				limit = {
					has_government = neutrality
				}
				remove_trait = {
					character = YUG_peter_ii
					ideology = conservatism
					trait = underage_monarch
				}
				add_trait = {
					character = YUG_peter_ii
					ideology = conservatism
					trait = legitimate_heir
				}
			}
			if = {
				limit = {
					has_government = democratic
				}
				remove_trait = {
					character = YUG_peter_ii
					ideology = despotism
					trait = underage_monarch
				}
				add_trait = {
					character = YUG_peter_ii
					ideology = despotism
					trait = legitimate_heir
				}
			}
			set_country_flag = peter_is_of_age
		}
	}
}

#The Royal Wedding
country_event = {
	id = DOD_yugoslavia.50
	title = DOD_yugoslavia.50.t
	desc = DOD_yugoslavia.50.desc
	picture = GFX_report_event_generic_rally
	
	is_triggered_only = yes

	fire_only_once = yes

	option = { #Historical (allies)
		name = DOD_yugoslavia.50.a
		hidden_effect = {
			save_global_event_target_as = yugoslavia_wedding_partner
		}
	}
	option = { #Italy
		name = DOD_yugoslavia.50.b
		trigger = {
			any_other_country = {
				original_tag = ITA
				NOT = { has_war_with = ROOT }
				NOT = { has_government = communism }
			}
		}
		random_country = {
			limit = {
				original_tag = ITA
				NOT = { has_government = communism }
			}
			country_event = {
				id = DOD_yugoslavia.501
				days = 10
			}
			hidden_effect = { save_global_event_target_as = yugoslavia_wedding_partner }
		}
	}
	option = { #Germany
		name = DOD_yugoslavia.50.c
		trigger = {
			any_other_country = {
				original_tag = GER
				NOT = { has_war_with = ROOT }
				OR = {
					has_completed_focus = GER_revive_the_kaiserreich
					has_completed_focus = GER_the_monarchy_compromise
				}
			}
		}
		random_country = {
			limit = {
				original_tag = GER
				OR = {
					has_completed_focus = GER_revive_the_kaiserreich
					has_completed_focus = GER_the_monarchy_compromise
				}
			}
			country_event = {
				id = DOD_yugoslavia.501
				days = 10
			}
			hidden_effect = { save_global_event_target_as = yugoslavia_wedding_partner }
		}
	}
	option = { #Austria-Hungary
		name = DOD_yugoslavia.50.d
		trigger = {
			any_other_country = {
				original_tag = HUN
				NOT = { has_war_with = ROOT }
				has_completed_focus = HUN_invite_the_habsburg_prince
			}
		}
		random_country = {
			limit = {
				original_tag = HUN
				has_completed_focus = HUN_invite_the_habsburg_prince
			}
			country_event = {
				id = DOD_yugoslavia.501
				days = 10
			}
			hidden_effect = { save_global_event_target_as = yugoslavia_wedding_partner }
		}
	}
	option = { #Spanish Princess
		name = DOD_yugoslavia.50.e
		trigger = {
			any_other_country = {
				original_tag = SPR
				NOT = { has_war_with = ROOT }
				has_completed_focus = SPA_settle_the_succession_question
			}
		}
		random_country = {
			limit = {
				original_tag = SPR
				has_completed_focus = SPA_settle_the_succession_question
			}
			country_event = {
				id = DOD_yugoslavia.501
				days = 10
			}
			hidden_effect = { save_global_event_target_as = yugoslavia_wedding_partner }
		}
	}
}

#Wedding partner can accept or decline
country_event = {
	id = DOD_yugoslavia.501
	title = DOD_yugoslavia.501.t
	desc = DOD_yugoslavia.501.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes

	option = { #Yes
		name = DOD_yugoslavia.501.a
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				has_guaranteed = YUG
			}
			modifier = {
				factor = 2
				has_non_aggression_pact_with = YUG
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = YUG
					value = 25
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = YUG
					value = 100
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = YUG
					value = 150
				}
			}
			modifier = {
				factor = 2
				has_government = neutrality
			}
		}
		FROM = {
			country_event = {
				id = DOD_yugoslavia.502
				days = 10
			}
			effect_tooltip = {
				add_opinion_modifier = { 
					target = ROOT
					modifier = YUG_royal_ties
				}
			}
		}
	}
	option = { #No
		name = DOD_yugoslavia.501.b
		ai_chance = {
			factor = 10
			modifier = {
				factor = 5
				has_wargoal_against = YUG
			}
			modifier = {
				factor = 5
				is_justifying_wargoal_against = YUG
			}
			modifier = {
				factor = 2
				has_government = fascism
			}
		}
		YUG = {
			country_event = {
				id = DOD_yugoslavia.503
				days = 10
			}
			hidden_effect = { save_global_event_target_as = yugoslavia_wedding_partner }
		}
	}
}

#Yugoslavia is informed of their choice
country_event = {
	id = DOD_yugoslavia.502
	title = DOD_yugoslavia.502.t
	desc = DOD_yugoslavia.502.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = DOD_yugoslavia.502.a
		add_opinion_modifier = { 
			target = FROM
			modifier = YUG_royal_ties
		}
		reverse_add_opinion_modifier = { 
			target = FROM
			modifier = YUG_royal_ties
		}
		if = {
			limit = {
				has_war = yes
			}
			add_stability = -0.1
		}
		else = {
			add_stability = 0.1
		}
	}
}

#Yugoslavia is informed of their rejection
country_event = {
	id = DOD_yugoslavia.503
	title = DOD_yugoslavia.503.t
	desc = DOD_yugoslavia.503.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = DOD_yugoslavia.503.a
		add_opinion_modifier = { 
			target = FROM
			modifier = small_decrease
		}
	}
}

#The Coronation
country_event = {
	id = DOD_yugoslavia.60
	title = DOD_yugoslavia.60.t
	desc = {
		text = DOD_yugoslavia.60.peter
		trigger = {
			has_country_leader = {
				character = YUG_peter_ii
				ruling_only = yes
			}
		}
	}
	desc = {
		text = DOD_yugoslavia.60.paul
		trigger = {
			has_country_leader = {
				character = YUG_prince_paul
				ruling_only = yes
			}
		}
	}
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = DOD_yugoslavia.60.a
		if = {
			limit = {
				has_country_leader = {
					character = YUG_prince_paul
					ruling_only = yes
				}
			}

			YUG_prince_paul = {
				add_country_leader_role = {
					country_leader = {
						expire = "1965.1.1"
						ideology = fascism_ideology
						traits = {
							collaborator_king
						}
					}
				promote_leader = yes
				}
			}
			
			set_party_name = { 
				ideology = fascism
				name = YUG_kardocevik
				long_name = YUG_kardocevik
			}
			set_party_name = { 
				ideology = neutrality
				name = YUG_peters_loyalists
				long_name = YUG_peters_loyalists
			}
			set_country_leader_name = {
				name = YUG_paul_i
			}
			add_ideas = { YUG_idea_orthodox_church_support }
			custom_effect_tooltip = all_subjects_become_fascist_tt
			hidden_effect = {
				every_other_country = {
					limit = {
						capital_scope = {
							is_on_continent = europe
						}
						NOT = { original_tag = YUG }
						has_government = neutrality
						is_subject_of = ROOT
					}
					set_variable = {
						var = monarchist_support_var
						value = party_popularity@neutrality
					}
					add_popularity = {
						ideology = fascism
						popularity = monarchist_support_var
					}
					set_politics = {
						ruling_party = fascism
					}
				}
			}
			hidden_effect = {
				if = {
					limit = {
						date > 1941.09.06
					}
					YUG_peter_ii = {
						swap_country_leader_traits = { remove = underage_monarch add = legitimate_heir }
					}
					hidden_effect = { 
						YUG_peter_ii = {
							set_portraits = {
								civilian = {
							    	large = GFX_portrait_yugoslavia_peter_ii_old
								}
							}					
						}
						set_country_flag = peter_is_of_age 
					}
				}
			}
			if = {
				limit = {
					has_government = neutrality
				}
				hidden_effect = {
					set_variable = {
						var = monarchist_support_var
						value = party_popularity@neutrality
					}
					add_popularity = {
						ideology = fascism
						popularity = monarchist_support_var
					}
				}
				custom_effect_tooltip = neutral_to_fascist_tt
				set_politics = {
					ruling_party = fascism
				}
			}
		}
		add_stability = 0.1
		add_war_support = 0.2
	}
}

#Signing the Tripartite Pact
country_event = {
	id = DOD_yugoslavia.70
	title = DOD_yugoslavia.70.t
	desc = DOD_yugoslavia.70.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = DOD_yugoslavia.70.a
		ai_chance = {
			factor = 10
		}
		add_opinion_modifier = { target = YUG modifier = tripartite_pact_opinion }
		reverse_add_opinion_modifier = { target = YUG modifier = tripartite_pact_opinion }
		if = {
			limit = { 
				ENG = {
					is_faction_leader = yes
					has_government = democratic
					NOT = { has_country_flag = has_already_decided_yugo_coup_flag }
				}
			}
			ENG = { country_event = { id = DOD_yugoslavia.702 days = 20 } }
		}
		else = {
			get_best_alliance_match_democratic_effect = yes
			var:best_leader = {
				country_event = { id = DOD_yugoslavia.702 days = 20 }
			}
		}
	}

	option = {
		name = DOD_yugoslavia.70.b
		ai_chance = {
			factor = 0
		}
		YUG = { 
			country_event = {
				id = DOD_yugoslavia.701 
				hours = 6
			}	
		}
	}
}

#Yugo is informed of their choice
country_event = {
	id = DOD_yugoslavia.701
	title = DOD_yugoslavia.701.t
	desc = {
		text = DOD_yugoslavia.701.tripartite_rejection
		trigger = {
			FROM = {
				has_government = fascism
			}
		}
	}
	desc = {
		text = DOD_yugoslavia.701.allied_objection
		trigger = {
			FROM = {
				has_government = democratic
			}
		}
	}
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes

	immediate = {
		hidden_effect = {
			set_country_flag = has_already_decided_yugo_coup_flag
		}
	}

	option = {
		name = DOD_yugoslavia.701.a
		ai_chance = {
			factor = 10
		}
		if = {
			limit = {
				FROM = {
					has_government = fascism
				}
			}
			add_opinion_modifier = { target = FROM modifier = small_decrease }
			FROM = { add_opinion_modifier = { target = YUG modifier = small_decrease } }
		}
		else = {
			if = {
				limit = {
					GER = {
						exists = yes
						has_capitulated = no
						has_government = fascism
						is_faction_leader = yes
					}
				}
				GER = {
					create_wargoal = {
						type = annex_everything
						target = YUG
					}
				}
				102 = {
					add_claim_by = GER
				}
			}
			else_if = {
				limit = {
					ITA = {
						exists = yes
						has_capitulated = no
						has_government = fascism
					}
				}
				ITA = {
					create_wargoal = {
						type = annex_everything
						target = YUG
					}
				}
			}
			ELSE = {
				add_stability = -0.05
			}
		}
		complete_national_focus = YUG_end_the_regency #switches to the Peter branch so Yugoslavia is not stuck
	}

	option = {
		name = DOD_yugoslavia.701.b #resist Britain's response
		trigger = {
			FROM = {
				has_government = democratic
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		YUG_start_peters_coup = yes
	}
}

# England can demand Paul to step down
country_event = {
	id = DOD_yugoslavia.702
	title = DOD_yugoslavia.702.t
	desc = DOD_yugoslavia.702.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes
	
	immediate = {
		hidden_effect = {
			set_country_flag = has_already_decided_yugo_coup_flag
		}
	}

	option = {
		name = DOD_yugoslavia.702.a
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0.5
				has_opinion = {
					target = YUG
					value = 25
				}
			}
			modifier = {
				factor = 0.5
				has_opinion = {
					target = YUG
					value = 100
				}
			}
			modifier = {
				factor = 0.5
				has_opinion = {
					target = YUG
					value = 150
				}
			}
		}
		YUG = { country_event = { id = DOD_yugoslavia.701 days = 10 } }
	}
	option = {
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				has_guaranteed = YUG
			}
			modifier = {
				factor = 0
				is_historical_focus_on = yes
				FROM = { is_ai = yes }
			}
		}
		name = DOD_yugoslavia.702.b
	}
}

# Italy recieves Yugo's request to control Zara
country_event = {
	id = DOD_yugoslavia.80
	title = DOD_yugoslavia.80.t
	desc = DOD_yugoslavia.80.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = DOD_yugoslavia.80.a
		ai_chance = {
			factor = 50
			
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 65
				}
			}
			
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 35
				}
			}
			
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 5
				}
			}
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value < 35
				}
			}
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value < 65
				}
			}
			
			modifier = {
				factor = 10
				has_war = yes
				FROM = {
					has_war = no
				}
			}
			
			modifier = {
				factor = 0.05
				has_war = no
				FROM = {
					has_war = yes
				}
			}

			modifier = {
				factor = 0
				ITA_is_alt_fascist_balbo_ai = yes	
			}
		}
		FROM = { transfer_state = 163 }
		
		if = {
			limit = {
				is_faction_leader = yes
			}
			add_to_faction = YUG
		}
		else = {
			random_country = {
				limit = {
					is_in_faction_with = ITA
					is_faction_leader = yes
				}
				add_to_faction = YUG
			}
		}
		FROM = { country_event = { id = DOD_yugoslavia.802 } }
	}
	
	option = {
		name = DOD_yugoslavia.80.b
		ai_chance = {
			factor = 50
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value > 65
				}
			}
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value > 35
				}
			}
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value > 5
				}
			}
			
			modifier = {
				factor = 2.0
				has_opinion = {
					target = FROM
					value < 35
				}
			}
			
			modifier = {
				factor = 2.0
				has_opinion = {
					target = FROM
					value < 65
				}
			}
			
			modifier = {
				factor = 0.1
				has_war = yes
				FROM = {
					has_war = no
				}
			}
			
			modifier = {
				factor = 0.5
				FROM = {
					is_in_faction = yes
				}
			}
			
			modifier = {
				factor = 0.1
				FROM = {
					is_major = yes
				}
			}
			
			modifier = {
				factor = 0
				is_major = no
			}
		}
		FROM = { country_event = { id = DOD_yugoslavia.801 } }
	}
}

#Yugo informed of rejection
country_event = {
	id = DOD_yugoslavia.801
	title = DOD_yugoslavia.801.t
	desc = DOD_yugoslavia.801.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes
	
	option = {
		name = DOD_yugoslavia.801.a #I'mma join anyway
		ITA = { transfer_state = 103 }
		if = {
			limit = {
				GER = {
					exists = yes
					has_capitulated = no
					has_government = fascism
					is_faction_leader = yes
				}
			}
			GER = { country_event = generic.2 }
		}
		else = {
			get_best_alliance_match_fascism_effect = yes
			var:best_leader = {
				country_event = generic.2
			}
		}
	}
	
	option = {
		name = DOD_yugoslavia.801.b
	}
}

#Yugo informed of acceptance
country_event = {
	id = DOD_yugoslavia.802
	title = DOD_yugoslavia.802.t
	desc = DOD_yugoslavia.802.desc
	picture = GFX_report_event_election_vote
	
	is_triggered_only = yes

	fire_only_once = yes
	
	option = {
		name = DOD_yugoslavia.802.a #Epic
		effect_tooltip = {
			transfer_state = 163
			if = {
				limit = {
					FROM = { is_faction_leader = yes }
				}
				FROM = { add_to_faction = YUG }
			}
			else = {
				random_country = {
					limit = {
						is_in_faction_with = FROM
						is_faction_leader = yes
					}
					add_to_faction = YUG
				}
			}
		}
	}
}

#Hidden event adding Yugoslavia's puppets to wars involving Yugo.
country_event = {
	id = DOD_yugoslavia.9
	
	is_triggered_only = yes

	hidden = yes
	
	option = {
		name = DOD_yugoslavia.9.a
		add_to_war = {
			targeted_alliance = YUG
			enemy = GER
			hostility_reason = asked_to_join
		}
	}
}