add_namespace = fbavaria

# The Bavarian Crisis
# Stored in separate file for easy compatibility with mods that change the mod
country_event = {
	id = fbavaria.51
	title = fbavaria.51.t
	desc = fbavaria.51.d
	picture = GFX_report_event_femboy_bavaria

	fire_only_once = yes
	is_triggered_only = yes

	#Play as Bavaria
	option = {
		name = fbavaria.51.a
		BVR = {
			hidden_effect = {
				transfer_state = 52
				transfer_state = 53
				transfer_state = 54
				transfer_state = 1047
				transfer_state = 1048
				transfer_state = 1049
				transfer_state = 1050
				add_state_core = 52
				add_state_core = 53
				add_state_core = 54
				add_state_core = 1047
				add_state_core = 1048
				add_state_core = 1049
				add_state_core = 1050
				BVR_ivan = {
					unit_leader_event = {
				    	id = fbavaria.62
				    	days = 2
					}
				}
				if = {
					limit = { has_dlc = "By Blood Alone" }
						load_oob = "BVR_1936_air_bba"
					else = {
						load_oob = "BVR_1936_air_legacy"
					}
				}
				inherit_technology = GER
				delete_unit_template_and_units = {
				    division_template = "Infanterie-Division"
				    disband = yes 
				}
				delete_unit_template_and_units = {
				    division_template = "Infanterie-Division (mot.)"
				    disband = yes 
				}
				load_oob = "BVR_1936"
				set_variable = { cuteness = 35 }
				52 = {
					add_resource = {
						type = steel
						amount = 10
					}
				}
			}
		}
		hidden_effect = {
			mark_focus_tree_layout_dirty = yes
			remove_ideas = GER_nsdap_infighting
			load_oob = "GER_civil_war_spam"
			remove_ideas = GER_bavarian_shadow_government
			start_civil_war = {
			    ruling_party = neutrality
			    ideology = fascism
			    size = 0.5
			    states = { 
			        50 42 51 55 57 56 60 59 65 66 67 68 63 54 810 809 808 53 52 807 978
			    }
			}
			load_oob = "GER_civil_war_2"
			random_other_country = {
				limit = {
					original_tag = GER
					has_government = fascism
				}
				set_cosmetic_tag = GER_rommelreich
				add_ideas = GER_nsdap_infighting
			}
			set_cosmetic_tag = GER_empire
			add_popularity = {
			    ideology = neutrality
			    popularity = 0.7
			}
		}
		BVR = {
			change_tag_from = GER
		}
	}

	#Play as Neutrality Germany
	option = {
		trigger = {
			# Hides this option
			# Should be set this way until New German Empire is given content
			always = no
		}
		name = fbavaria.51.b
		hidden_effect = {
			remove_ideas = GER_nsdap_infighting
			remove_ideas = GER_bavarian_shadow_government
			load_oob = "GER_civil_war_spam"
			BVR = {
				if = {
					limit = { has_dlc = "By Blood Alone" }
						load_oob = "BVR_1936_air_bba"
					else = {
						load_oob = "BVR_1936_air_legacy"
					}
				}
				transfer_state = 52
				transfer_state = 53
				transfer_state = 54
				transfer_state = 1047
				transfer_state = 1048
				transfer_state = 1049
				transfer_state = 1050
				add_state_core = 52
				add_state_core = 53
				add_state_core = 54
				add_state_core = 1047
				add_state_core = 1048
				add_state_core = 1049
				add_state_core = 1050
				BVR_ivan = {
					unit_leader_event = {
				    	id = fbavaria.62
				    	days = 2
					}
				}
				inherit_technology = GER
				delete_unit_template_and_units = {
				    division_template = "Infanterie-Division"
				    disband = yes 
				}
				delete_unit_template_and_units = {
				    division_template = "Infanterie-Division (mot.)"
				    disband = yes 
				}
				load_oob = "BVR_1936"
				set_variable = { cuteness = 35 }
				52 = {
					add_resource = {
						type = steel
						amount = 10
					}
				}
			}
		}
		hidden_effect = {
			start_civil_war = {
			    ruling_party = neutrality
			    ideology = fascism
			    size = 0.5
			    states = { 
			        50 42 51 55 57 56 60 59 65 66 67 68 63
			    }
			}
			mark_focus_tree_layout_dirty = yes
			add_popularity = {
			    ideology = neutrality
			    popularity = 0.7
			}
			random_other_country = {
				limit = {
					original_tag = GER
					has_government = fascism
				}
				set_cosmetic_tag = GER_rommelreich
				add_ideas = GER_nsdap_infighting
			}
			set_cosmetic_tag = GER_empire
			load_oob = "GER_civil_war_2"
		}
	}
}