WNG_improve_economy = {
	if = {
		limit = {
			has_idea = WNG_economic_crisis
		}
		swap_ideas = {
			remove_idea = WNG_economic_crisis
			add_idea = WNG_economic_growth_0
		}
	}
	else_if = {
		limit = {
			has_idea = WNG_economic_growth_0
		}
		swap_ideas = {
			remove_idea = WNG_economic_growth_0
			add_idea = WNG_economic_growth_1
		}
	}
	else = {
		remove_ideas = WNG_economic_growth_1
		# swap_ideas = {
		# 	remove_idea = WNG_economic_growth_1
		# 	add_idea = WNG_economic_growth_2
		# }
	}
}

WNG_tarrin_compromise_effect = {
	JER = {
		set_country_flag = WNG_tarrin_compromise_met
	}
	if = {
		limit = {
			has_global_flag = WNG_tarrin_compromise_componsation
		}
		WNG = {
			add_timed_idea = { idea = WNG_compensation_for_JER  days = 365 }
		}
		JER = {
			add_timed_idea = { idea = WNG_compensation_from_WNG  days = 365 } 
			diplomatic_relation = {
				country = FRN
				relation = non_aggression_pact
				active = yes
			}
		}
	}
	else_if = {
		limit = {
			has_global_flag = WNG_tarrin_compromise_half
		}
		JER = {
			if = {
				limit = {
					FRN = {
						owns_state = 487
					}
				}
				transfer_state = 487
			}
			diplomatic_relation = {
				country = FRN
				relation = non_aggression_pact
				active = yes
			}
		}
	}
	else = {
		JER = {
			if = {
				limit = {
					FRN = {
						owns_state = 487
					}
				}
				transfer_state = 487
			}
			if = {
				limit = {
					FRN = {
						owns_state = 652
					}
				}
				transfer_state = 652
			}
			if = {
				limit = {
					FRN = {
						owns_state = 521
					}
				}
				transfer_state = 521
			}
		}
	}
}

WNG_improve_army = {
	custom_effect_tooltip = WNG_improve_army_tt
	if = {
		limit = {
			has_idea = WNG_outdated_army
		}
		swap_ideas = {
			remove_idea = WNG_outdated_army
			add_idea = WNG_outdated_army_2
		}
	}
	else_if = {
		limit = {
			has_idea = WNG_outdated_army_2
		}
		swap_ideas = {
			remove_idea = WNG_outdated_army_2
			add_idea = WNG_outdated_army_3
		}
	}
	else = {
		remove_ideas = WNG_outdated_army_3
	}
}

WNG_check_popular_support_idea = {
	hidden_effect = {
		if = {
			limit = {
				check_variable = { WNG_popular_support < 25 }
				NOT = {
					has_idea = WNG_popular_support_idea_0
				}
			}
			remove_ideas = {
				WNG_popular_support_idea_1
				WNG_popular_support_idea_2
				WNG_popular_support_idea_3
			}
			add_ideas = WNG_popular_support_idea_0
		}
		else_if = {
			limit = {
				check_variable = { WNG_popular_support < 50 }
				NOT = {
					has_idea = WNG_popular_support_idea_1
				}
			}
			remove_ideas = {
				WNG_popular_support_idea_0
				WNG_popular_support_idea_2
				WNG_popular_support_idea_3
			}
			add_ideas = WNG_popular_support_idea_1
		}
		else_if = {
			limit = {
				check_variable = { WNG_popular_support < 75 }
				NOT = {
					has_idea = WNG_popular_support_idea_2
				}
			}
			remove_ideas = {
				WNG_popular_support_idea_0
				WNG_popular_support_idea_1
				WNG_popular_support_idea_3
			}
			add_ideas = WNG_popular_support_idea_2
		}
		else_if = {
			limit = {
				check_variable = { WNG_popular_support > 74 }
				NOT = {
					has_idea = WNG_popular_support_idea_3
				}
			}
			remove_ideas = {
				WNG_popular_support_idea_0
				WNG_popular_support_idea_1
				WNG_popular_support_idea_2
			}
			add_ideas = WNG_popular_support_idea_3
		}
	}
}

WNG_add_5_popular_support = {
	custom_effect_tooltip = WNG_add_5_popular_support
	add_to_variable = {
		var = WNG_popular_support
		value = 5
	}
	clamp_variable = {
		var = WNG_popular_support
		min = WNG_popular_support_min
		max = WNG_popular_support_max
	}
	WNG_check_popular_support_idea = yes
}
WNG_add_10_popular_support = {
	custom_effect_tooltip = WNG_add_10_popular_support
	add_to_variable = {
		var = WNG_popular_support
		value = 10
	}
	clamp_variable = {
		var = WNG_popular_support
		min = WNG_popular_support_min
		max = WNG_popular_support_max
	}
	WNG_check_popular_support_idea = yes
}
WNG_add_15_popular_support = {
	custom_effect_tooltip = WNG_add_15_popular_support
	add_to_variable = {
		var = WNG_popular_support
		value = 15
	}
	clamp_variable = {
		var = WNG_popular_support
		min = WNG_popular_support_min
		max = WNG_popular_support_max
	}
	WNG_check_popular_support_idea = yes
}
WNG_add_5_min_popular_support = {
	custom_effect_tooltip = WNG_add_5_min_popular_support
	add_to_variable = {
		var = WNG_popular_support_min
		value = 5
	}
	clamp_variable = {
		var = WNG_popular_support
		min = WNG_popular_support_min
		max = WNG_popular_support_max
	}
	WNG_check_popular_support_idea = yes
}
WNG_take_10_popular_support = {
	custom_effect_tooltip = WNG_take_10_popular_support
	add_to_variable = {
		var = WNG_popular_support
		value = -10
	}
	clamp_variable = {
		var = WNG_popular_support
		min = WNG_popular_support_min
		max = WNG_popular_support_max
	}
	WNG_check_popular_support_idea = yes
}

WNG_clear_parliament = {
	hidden_effect = {
		clr_country_flag = WNG_start_elections
		clr_country_flag = WNG_beakolini_parliament
		clr_country_flag = WNG_beakolini_parliament_b
		clr_country_flag = WNG_beakolini_parliament_c
	}
}

WNG_start_anti_fascist_civil_war = {
	set_variable = {
		var = civil_war_size_var
		value = party_popularity@democratic
	}
	add_to_variable = {
		var = civil_war_size_var
		value = party_popularity@communism
	}
	clamp_variable = {
		var = civil_war_size_var
		min = 0.1
		max = 0.9
	}
	start_civil_war = {
		ideology = communism
		size = civil_war_size_var
	}
	clear_variable = civil_war_size_var
	custom_effect_tooltip = WNG_only_fascism_government_tt
	hidden_effect = {
		setup_WNG_only_fascism_government = yes
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
	}
	add_ideas = WNG_only_fascism_idea
}

WNG_start_anti_fascist_civil_war_monarchy = {
	add_to_variable = {
		var = civil_war_size_var
		value = party_popularity@neutrality
	}
	add_to_variable = {
		var = civil_war_size_var
		value = party_popularity@communism
	}
	add_to_variable = {
		var = civil_war_size_var
		value = party_popularity@democratic
	}
	clamp_variable = {
		var = civil_war_size_var
		min = 0.1
		max = 0.9
	}
	start_civil_war = {
		ideology = neutrality
		size = civil_war_size_var
	}
	clear_variable = civil_war_size_var
				if = {
				limit = {
					has_idea = WNG_political_deadlock
				}
				remove_ideas = WNG_political_deadlock
			}
					swap_ruler_traits = {
					remove = aspiring_duce
					add = duce
				}
			WNG_giulio_beakolini = {
			set_portraits = {
				civilian = {
					large = "gfx/leaders/WNG/portrait_wingbardy_giulio_beakolini.tga"
				}
			}
		}
	custom_effect_tooltip = WNG_only_fascism_government_tt
	custom_effect_tooltip = WNG_fascist_republic
	set_cosmetic_tag = WNG_republic
	set_country_flag = have_regular_puppets
	remove_opinion_modifier = {
		target = MIT
		modifier = SIC_antimonarchism
	}
	remove_opinion_modifier = {
		target = SIC
		modifier = SIC_antimonarchism
	}
	MIT = {
		remove_opinion_modifier = {
			target = ROOT
			modifier = SIC_antimonarchism
		}
	}
	SIC = {
		remove_opinion_modifier = {
			target = ROOT
			modifier = SIC_antimonarchism
		}
	}
	hidden_effect = {
		setup_WNG_only_fascism_government = yes
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
		random_other_country = {
							limit = {
				original_tag = WNG
				has_government = neutrality
			}
						if = {
				limit = {
					has_idea = WNG_political_deadlock
				}
				remove_ideas = WNG_political_deadlock
			}
		set_cosmetic_tag = WNG_rebellion
				set_party_name = { 
		    ideology = neutrality
		    name = WNG_regio_esercito_name
		    long_name = WNG_regio_esercito_name
		}
				add_country_leader_role = {
			character = WNG_gietro_gadoglio
			country_leader = {
				expire = "1965.1.1"
				ideology = centrism
				traits = {  }
			}
			promote_leader = yes
		}
					add_popularity = {
				ideology = communism
				popularity = 0.10
			}
			add_popularity = {
				ideology = democratic
				popularity = 0.25
			}
							load_focus_tree = {
				tree = wingbardy_focus_tree
				keep_completed = no
			}
			unlock_national_focus = WNG_declare_martial_law
		}
	}
	add_ideas = WNG_only_fascism_idea
}

WNG_start_anti_monarchy_civil_war = {
	set_temp_variable = { civil_war_size_var = 100 }
	subtract_from_temp_variable = { civil_war_size_var = WNG_popular_support }
	multiply_temp_variable = { civil_war_size_var = 0.01 }
	if = {
		limit = {
			has_completed_focus = WNG_secure_army_loyalty
		}
		add_to_variable = {
			civil_war_size_var = 0.25
		}
	}
	if = {
		limit = {
			check_variable = {
				var = civil_war_size_var
				value = 0.2
				compare = less_than
			}
		}
		set_variable = {
			var = civil_war_size_var
			value = 0.2
		}
	}
	else_if = {
		limit = {
			check_variable = {
				var = civil_war_size_var
				value = 0.9
				compare = greater_than
			}
		}
		set_variable = {
			var = civil_war_size_var
			value = 0.9
		}
	}
	start_civil_war = {
		ideology = democratic
		size = civil_war_size_var
	}
	set_global_flag = WNG_civil_war
	hidden_effect = {
		random_other_country = {
			limit = {
				original_tag = WNG
				has_government = democratic
			}
			set_country_flag = have_regular_puppets
			remove_opinion_modifier = {
				target = MIT
				modifier = SIC_antimonarchism
			}
			remove_opinion_modifier = {
				target = SIC
				modifier = SIC_antimonarchism
			}
			MIT = {
				remove_opinion_modifier = {
					target = ROOT
					modifier = SIC_antimonarchism
				}
			}
			SIC = {
				remove_opinion_modifier = {
					target = ROOT
					modifier = SIC_antimonarchism
				}
			}
			remove_ideas = WNG_martial_law
			set_cosmetic_tag = WNG_wingbardian_liberation_movement
			add_country_leader_role = {
				character = WNG_national_liberation_committee
				country_leader = {
					expire = "1965.1.1"
					ideology = liberation_front
					traits = { anti_fascist_committee }
				}
				promote_leader = yes
			}
			set_party_name = {
				ideology = democratic
				long_name = WNG_nlc
				name = WNG_nlc
			}
			add_ideas = WNG_liberty_or_death
			set_popularities = {
				democratic = 45
				communism = 45
				neutrality = 10
			}
			set_stability = 0.8
			set_war_support = 0.8
			division_template = {
				name = "Guardia Rossa"
				is_locked = yes
			
				regiments = {
					militia = { x = 0 y = 0 }
					militia = { x = 0 y = 1 }
					militia = { x = 0 y = 2 }
					militia = { x = 1 y = 0 }
					militia = { x = 1 y = 1 }
					militia = { x = 1 y = 2 }
				}
				priority = 0
			}
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"1a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"2a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"3a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"4a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
			}
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"11a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"12a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"13a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
			}
			if = {
				limit = {
					owns_state = 371
				}
				371 = {
					create_unit = { 
						division = "name = \"5a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
						owner = ROOT
					}
					create_unit = { 
						division = "name = \"6a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
						owner = ROOT
					}
					create_unit = { 
						division = "name = \"7a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
						owner = ROOT
					}
				}
			}
			
			load_focus_tree = {
				tree = wingbardy_focus_tree
				keep_completed = no
			}
			unlock_national_focus = WNG_prepare_the_counterrevolution
			unlock_national_focus = WNG_reach_out_to_the_liberal_generals
			unlock_national_focus = WNG_secure_police_support
			unlock_national_focus = WNG_promise_labour_reforms
			unlock_national_focus = WNG_mobilise_the_trade_unions
			unlock_national_focus = WNG_anti_fascist_propoganda
			unlock_national_focus = WNG_reach_out_to_stalliongrad
	
			save_event_target_as = WNG_anti_monarchy_civil_war
			every_character = {
				limit = { is_unit_leader = yes }
				set_nationality = WNG
			}
			WNG = {
				every_character = {
					limit = {
						OR = {
							is_character = WNG_giuseppe_gellera
							is_character = WNG_gannibale_gergonzoli
							is_character = WNG_giovanni_gesse
							is_character = WNG_garlo_geloso
							is_character = WNG_galfredo_guzzoni
							is_character = WNG_gettore_gastico
						}
					}
					set_nationality = event_target:WNG_anti_monarchy_civil_war
				}
			}
		}
	}
}
gsdffgrvmwp = {
	country_event = { id = ncr_militarists.6 days = 1 }
}
WNG_start_civil_war_commie = {

	if = {
		limit = {
			NOT = {
				371 = {
					has_state_flag = WNG_communist_state
				}
			}
		}
		set_capital = { state = 369 } # Worbert is the capital of the revolution if Karthin is in Fascist talons
	}

	set_temp_variable = {
		WNG_civil_war_size = 0.6
	}
	if = {
		limit = {
			has_completed_focus = WNG_reach_out_to_the_liberal_generals
		}
		add_to_temp_variable = {
			WNG_civil_war_size = -0.1
		}
	}

	start_civil_war = {
		ruling_party = democratic
		ideology = fascism
		size = WNG_civil_war_size
		states = all
		states_filter = {
			NOT = { has_state_flag = WNG_communist_state }
		}
	}

	set_cosmetic_tag = WNG_wingbardian_liberation_movement

	add_country_leader_role = {
		character = WNG_national_liberation_committee
		country_leader = {
			expire = "1965.1.1"
			ideology = liberation_front
			traits = { anti_fascist_committee }
		}
		promote_leader = yes
	}
	set_party_name = {
		ideology = democratic
		long_name = WNG_nlc
		name = WNG_nlc
	}
	
	if = {
		limit = {
			has_completed_focus = WNG_mobilise_the_trade_unions
		}
		add_ideas = WNG_mobilised_the_trade_unions
	}
	add_ideas = WNG_liberty_or_death

	hidden_effect = {
		set_global_flag = WNG_civil_war
		set_country_flag = have_regular_puppets
		remove_opinion_modifier = {
			target = MIT
			modifier = SIC_antimonarchism
		}
		remove_opinion_modifier = {
			target = SIC
			modifier = SIC_antimonarchism
		}
		MIT = {
			remove_opinion_modifier = {
				target = ROOT
				modifier = SIC_antimonarchism
			}
		}
		SIC = {
			remove_opinion_modifier = {
				target = ROOT
				modifier = SIC_antimonarchism
			}
		}
		if = {
			limit = {
				has_idea = WNG_garibald_talonuel_iii
			}
			remove_ideas = WNG_garibald_talonuel_iii
		}

		set_popularities = {
			democratic = 45
			communism = 45
			neutrality = 10
		}

		add_popularity = {
			ideology = democratic
			popularity = var:democratic_civil_war_support
		}
		add_popularity = {
			ideology = communism
			popularity = var:communism_civil_war_support
		}
		add_stability = var:civil_war_bonus_stability

		division_template = {
			name = "Guardia Rossa"
			is_locked = yes
		
			regiments = {
				militia = { x = 0 y = 0 }
				militia = { x = 0 y = 1 }
				militia = { x = 0 y = 2 }
				militia = { x = 1 y = 0 }
				militia = { x = 1 y = 1 }
				militia = { x = 1 y = 2 }
			}
			priority = 0
		}
		random_owned_controlled_state = {
			create_unit = { 
				division = "name = \"1a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
				owner = ROOT
			}
			create_unit = { 
				division = "name = \"2a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
				owner = ROOT
			}
			create_unit = { 
				division = "name = \"3a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
				owner = ROOT
			}
			create_unit = { 
				division = "name = \"4a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
				owner = ROOT
			}
		}
		random_owned_controlled_state = {
			create_unit = { 
				division = "name = \"11a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
				owner = ROOT
			}
			create_unit = { 
				division = "name = \"12a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
				owner = ROOT
			}
			create_unit = { 
				division = "name = \"13a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
				owner = ROOT
			}
		}
		if = {
			limit = {
				owns_state = 371
			}
			371 = {
				create_unit = { 
					division = "name = \"5a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"6a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"7a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
			}
		}
		if = {
			limit = {
				has_completed_focus = WNG_arm_the_red_guard
			}
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"8a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"9a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"10a Guardia Rossa\" division_template = \"Guardia Rossa\" start_experience_factor = 0.5" 
					owner = ROOT
				}
			}
		}

		# Fascist Wingbardy
		random_other_country = {
			limit = {
				original_tag = WNG
				has_government = fascism
			}
			#save_event_target_as = fascist_wingbardy_civil_war
			add_popularity = {
				ideology = neutrality
				popularity = 0.2
			}
			add_popularity = {
				ideology = democratic
				popularity = 0.2
			}
							swap_ruler_traits = {
			remove = aspiring_duce
			add = duce
		}
		WNG_giulio_beakolini = {
			set_portraits = {
				civilian = {
					large = "gfx/leaders/WNG/portrait_wingbardy_giulio_beakolini.tga"
				}
			}
		}
			if = {
				limit = {
					NOT = {
						has_idea = WNG_garibald_talonuel_iii
					}
				}
				add_ideas = WNG_garibald_talonuel_iii
			}
			if = {
				limit = {
					has_idea = WNG_political_deadlock
				}
				remove_ideas = WNG_political_deadlock
			}
			
			set_cosmetic_tag = WNG_other_side

			division_template = {
				name = "Fascist Militia"
				is_locked = yes
			
				regiments = {
					militia = { x = 0 y = 0 }
					militia = { x = 0 y = 1 }
					militia = { x = 0 y = 2 }
					militia = { x = 1 y = 0 }
					militia = { x = 1 y = 1 }
					militia = { x = 1 y = 2 }
				}
				priority = 0
			}
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"1a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
				create_unit = { 
					division = "name = \"2a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
				create_unit = { 
					division = "name = \"3a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
				create_unit = { 
					division = "name = \"4a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
			}
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"5a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
				create_unit = { 
					division = "name = \"6a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
				create_unit = { 
					division = "name = \"7a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
				create_unit = { 
					division = "name = \"8a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
			}
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"9a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
				create_unit = { 
					division = "name = \"10a Divisione Fascista\" division_template = \"Fascist Militia\" start_experience_factor = 0.5" 
					owner = PREV
				}
			}
			load_focus_tree = {
				tree = wingbardy_focus_tree
				keep_completed = no
			}
			unlock_national_focus = WNG_meet_with_beakolini
			complete_national_focus = WNG_legitimise_the_blackwings
			unlock_national_focus = WNG_the_gacerbo_law
		}

		if = {
			limit = {
				has_completed_focus = WNG_secure_police_support
			}
			division_template = {
				name = "Brigata Carabinieri"
				is_locked = yes
			
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
				}
			}
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"1a Brigata Carabinieri\" division_template = \"Brigata Carabinieri\" start_experience_factor = 0.7" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"2a Brigata Carabinieri\" division_template = \"Brigata Carabinieri\" start_experience_factor = 0.7" 
					owner = ROOT
				}
				create_unit = { 
					division = "name = \"3a Brigata Carabinieri\" division_template = \"Brigata Carabinieri\" start_experience_factor = 0.7" 
					owner = ROOT
				}
			}
		}
		else = {
			random_other_country = {
				limit = {
					original_tag = WNG
					has_government = fascism
				}
				division_template = {
					name = "Brigata Carabinieri"
					is_locked = yes
				
					regiments = {
						infantry = { x = 0 y = 0 }
						infantry = { x = 0 y = 1 }
						infantry = { x = 0 y = 2 }
					}
				}
				random_owned_controlled_state = {
					create_unit = { 
						division = "name = \"1a Brigata Carabinieri\" division_template = \"Brigata Carabinieri\" start_experience_factor = 0.7" 
						owner = PREV
					}
					create_unit = { 
						division = "name = \"2a Brigata Carabinieri\" division_template = \"Brigata Carabinieri\" start_experience_factor = 0.7" 
						owner = PREV
					}
					create_unit = { 
						division = "name = \"3a Brigata Carabinieri\" division_template = \"Brigata Carabinieri\" start_experience_factor = 0.7" 
						owner = PREV
					}
				}
			}
		}

		news_event = { id = news_wingbardy.7 hours = 6 }

		add_named_threat = {
			threat = 1
			name = WNG_civil_war_name
		}

		random_country_with_original_tag = {
			original_tag_to_check = TAL
			limit = {
				is_in_faction_with = WNG
			}
			save_event_target_as = TAL_karthin_pact
		}
		random_country_with_original_tag = {
			original_tag_to_check = ARA
			limit = {
				is_in_faction_with = WNG
			}
			save_event_target_as = ARA_karthin_pact
		}
		random_country_with_original_tag = {
			original_tag_to_check = FRN
			limit = {
				is_in_faction_with = WNG
			}
			save_event_target_as = FRN_karthin_pact
		}

		# End the Karthin Pact
		# Effects for former Pact allies
		dismantle_faction = yes

		event_target:TAL_karthin_pact = {
			diplomatic_relation = { country = event_target:ARA_karthin_pact relation = guarantee active = yes }
			diplomatic_relation = { country = event_target:FRN_karthin_pact relation = guarantee active = yes }
		}
		event_target:ARA_karthin_pact = {
			diplomatic_relation = { country = event_target:TAL_karthin_pact relation = guarantee active = yes }
			diplomatic_relation = { country = event_target:FRN_karthin_pact relation = guarantee active = yes }
		}
		event_target:FRN_karthin_pact = {
			diplomatic_relation = { country = event_target:ARA_karthin_pact relation = guarantee active = yes }
			diplomatic_relation = { country = event_target:TAL_karthin_pact relation = guarantee active = yes }
		}
		FRN = {
			country_event = francistria.85
		}
		ABY = {
			country_event = wingbardy.63
			if = {
				limit = {
					has_government = fascism
				}
				country_event = { id = abyssinia.132 days = 1 }
			}
		}
		if = {
			limit = {
				has_country_flag = STG_WNG_help
			}
			country_event = {
				id = wingbardy.74
				days = 7
				random_days = 2
			}
		}
	}

	# Ensure unit leaders are properly distributed
	hidden_effect = {
		if = {
			limit = {
				has_civil_war = yes
			}
			random_other_country = {
				limit = {
					original_tag = WNG
					has_government = fascism
				}
				save_event_target_as = fascist_wingbardy_civil_war
			}
			WNG = {
				every_character = {
					limit = { is_unit_leader = yes }
					set_nationality = event_target:fascist_wingbardy_civil_war
				}
				event_target:fascist_wingbardy_civil_war = {
					every_character = {
						limit = {
							OR = {
								is_character = WNG_giuseppe_gellera
								is_character = WNG_gannibale_gergonzoli
								is_character = WNG_garrigo_goldrini
								is_character = WNG_riccardo_gedel
								is_character = WNG_gaolo_caccia_gominioni
							}
						}
						set_nationality = WNG
					}
				}
				if = {
					limit = {
						has_completed_focus = WNG_reach_out_to_the_liberal_generals
					}
					event_target:fascist_wingbardy_civil_war = {
						every_character = {
							limit = {
								OR = {
									is_character = WNG_giovanni_gesse
									is_character = WNG_garlo_geloso
									is_character = WNG_galfredo_guzzoni
									is_character = WNG_gettore_gastico
								}
							}
							set_nationality = WNG
						}
					}
				}
			}
		}
	}
}

WNG_reduce_mafia = {
	custom_effect_tooltip = WNG_reduce_mafia_tt
	if = {
		limit = {
			has_idea = WNG_mafia_3
		}
		swap_ideas = {
			remove_idea = WNG_mafia_3
			add_idea = WNG_mafia_2
		}
	}
	else_if = {
		limit = {
			has_idea = WNG_mafia_2
		}
		swap_ideas = {
			remove_idea = WNG_mafia_2
			add_idea = WNG_mafia_1
		}
	}
	else_if = {
		limit = {
			has_idea = WNG_mafia_1
		}
		swap_ideas = {
			remove_idea = WNG_mafia_1
			add_idea = WNG_mafia_0
		}
	}
}
WNG_increase_mafia = {
	if = {
		limit = {
			has_idea = WNG_mafia_0
		}
		swap_ideas = {
			remove_idea = WNG_mafia_0
			add_idea = WNG_mafia_1
		}
	}
	else_if = {
		limit = {
			has_idea = WNG_mafia_1
		}
		swap_ideas = {
			remove_idea = WNG_mafia_1
			add_idea = WNG_mafia_2
		}
	}
	else_if = {
		limit = {
			has_idea = WNG_mafia_2
		}
		swap_ideas = {
			remove_idea = WNG_mafia_2
			add_idea = WNG_mafia_3
		}
	}
}

WNG_set_gumberto_ii_country_leader = {
	if = {
		limit = {
			WNG_prince_gumberto = { is_unit_leader = yes }
		}
		WNG_prince_gumberto = { remove_unit_leader_role = yes }
	}
	WNG_prince_gumberto = {
		set_character_name = WNG_gumberto_ii
		add_country_leader_role = {
			country_leader = {
				ideology = despotism
				expire = "1965.1.1.1"
			}
			promote_leader = yes
		}
	}
	if = {
		limit = {
			has_country_flag = WNG_gumberto_1
		}
		WNG_prince_gumberto = {
			add_country_leader_trait = true_hedonist
		}
	}
	else_if = {
		limit = {
			has_country_flag = WNG_gumberto_2
		}
		set_party_name = {
			ideology = fascism
			name = WNG_monarchy_party
			long_name = WNG_monarchy_party_long
		}
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
		WNG_prince_gumberto = {
			add_country_leader_trait = prince_of_blackwings
			add_country_leader_role = {
				country_leader = {
					ideology = nazism
					traits = { prince_of_blackwings }
					expire = "1965.1.1.1"
				}
				promote_leader = yes
			}
		}
	}
	else_if = {
		limit = {
			has_country_flag = WNG_gumberto_3
		}
		set_party_name = {
			ideology = fascism
			name = WNG_monarchy_party
			long_name = WNG_monarchy_party_long
		}
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
		WNG_prince_gumberto = {
			add_country_leader_trait = king_of_blackwings
			add_country_leader_role = {
				country_leader = {
					ideology = nazism
					traits = { king_of_blackwings }
					expire = "1965.1.1.1"
				}
				promote_leader = yes
			}
		}
	}
	else_if = {
		limit = {
			has_country_flag = WNG_gumberto_4
		}
		WNG_prince_gumberto = {
			add_country_leader_trait = prince_of_wingbardy
		}
	}
	else_if = {
		limit = {
			has_country_flag = WNG_gumberto_5
		}
		WNG_prince_gumberto = {
			add_country_leader_trait = king_of_wingbardy
		}
	}
	else = {
		WNG_prince_gumberto = {
			add_country_leader_trait = hedonist
		}
	}
}

WNG_add_reinvest_in_air_aircraft = {
	create_equipment_variant = {
		name = "Ro.57"
		type = medium_plane_fighter_airframe_1
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = light_mg_4x
				fixed_auxiliary_weapon_slot_1 = aircraft_cannon_1_2x
				fixed_auxiliary_weapon_slot_2 = empty
				fixed_auxiliary_weapon_slot_3 = empty
				fixed_auxiliary_weapon_slot_4 = empty
				fixed_auxiliary_weapon_slot_5 = lmg_defense_turret_2x
				fixed_auxiliary_weapon_slot_6 = empty				
				engine_type_slot = engine_2_2x
				special_type_slot_1 = armor_plate_medium
				special_type_slot_2 = self_sealing_fuel_tanks_medium
				special_type_slot_3 = high_octane_fuel_medium
				special_type_slot_4 = empty
				special_type_slot_5 = empty
				special_type_slot_6 = empty
				special_type_slot_7 = empty
			}
		icon = "GFX_ITA_heavy_fighter1_medium"
	}

	create_equipment_variant = {
		name = "C.200 Saetta"
		type = small_plane_airframe_1
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = heavy_mg_2x
				fixed_auxiliary_weapon_slot_1 = empty
				fixed_auxiliary_weapon_slot_2 = empty					
				engine_type_slot = radial_engine_2_1x
				special_type_slot_1 = NACA_cowling
				special_type_slot_2 = empty
				special_type_slot_3 = empty
				special_type_slot_4 = self_sealing_fuel_tanks_small
				special_type_slot_5 = empty
				special_type_slot_6 = empty	
				special_type_slot_7 = early_supercharger
				special_type_slot_8 = canopy1
				special_type_slot_9 = empty	
			}
		icon = "GFX_ITA_fighter1_medium"
	}

	create_equipment_variant = {
		name = "Ca.310"
		type = small_plane_cas_airframe_1
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = bomb_locks
				fixed_auxiliary_weapon_slot_1 = recon_camera
				fixed_auxiliary_weapon_slot_6 = lmg_defense_turret
				engine_type_slot = radial_engine_2_1x
				special_type_slot_1 = NACA_cowling
				special_type_slot_2 = dive_brakes_small
				special_type_slot_3 = fuel_tanks_small
				special_type_slot_4 = armor_plate_small
				special_type_slot_5 = empty
				special_type_slot_6 = empty
				special_type_slot_7 = normally_aspirated_engine
				special_type_slot_8 = canopy1
				special_type_slot_9 = empty	
			}
		icon = "GFX_ITA_CAS2_medium"
	}
}

WNG_add_re2000_template = {
	create_equipment_variant = {
		name = "Re.2000"
		type = small_plane_airframe_1
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = heavy_mg_2x
				engine_type_slot = engine_1_1x
				special_type_slot_7 = normally_aspirated_engine
				special_type_slot_8 = canopy1
			}
		icon = "GFX_ITA_fighter1_medium"
	}
}

WNG_add_c202_template = {
	create_equipment_variant = {
		name = "C.202 Folgore"
		type = small_plane_airframe_2
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = light_mg_2x
				fixed_auxiliary_weapon_slot_1 = heavy_mg_2x #cannot use any_of in effect!
				engine_type_slot = engine_3_1x
				special_type_slot_1 = drop_tanks
				special_type_slot_2 = armor_plate_small
				special_type_slot_3 = self_sealing_fuel_tanks_small
				special_type_slot_7 = early_supercharger
				special_type_slot_8 = canopy1
				special_type_slot_9 = reflex_gunsight_1	
			}
		icon = "GFX_ITA_fighter2_medium"
	}
}
WNG_add_g55_template = {
	create_equipment_variant = {
		name = "G.55 Centauro"
		type = small_plane_airframe_3
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = aircraft_cannon_1_2x
				fixed_auxiliary_weapon_slot_1 = aircraft_cannon_1_2x
				fixed_auxiliary_weapon_slot_2 = empty	
				fixed_auxiliary_weapon_slot_3 = empty				
				engine_type_slot = engine_4_1x
				special_type_slot_1 = drop_tanks
				special_type_slot_2 = supercharger 
				special_type_slot_3 = pressurized_cockpit
				special_type_slot_4 = armor_plate_small
				special_type_slot_5 = water_injection_small	
				special_type_slot_6 = empty	
			}
		icon = "GFX_ITA_fighter3_medium"
	}
}
WNG_add_CANT_Z1007_template = {
	create_equipment_variant = {
		name = "CANT Z.1007 Alcione"
		type = medium_plane_airframe_1
		parent_version = 0
		modules = {
					fixed_main_weapon_slot = medium_bomb_bay
					fixed_auxiliary_weapon_slot_1 = bomb_locks
					fixed_auxiliary_weapon_slot_2 = torpedo_mounting
					fixed_auxiliary_weapon_slot_3 = torpedo_mounting
					fixed_auxiliary_weapon_slot_5 = lmg_defense_turret_2x
					fixed_auxiliary_weapon_slot_6 = hmg_defense_turret_2x
					engine_type_slot = engine_3_3x #Increased tier due to thrust/weight issues
					special_type_slot_7 = normally_aspirated_engine
			}
		icon = "GFX_ITA_tactical_bomber1_medium"
	}
}
WNG_add_ba201_template = {
	create_equipment_variant = {
		name = "Ba.201"
		type = small_plane_cas_airframe_2
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = bomb_locks
				fixed_auxiliary_weapon_slot_1 = tank_buster_2
				fixed_auxiliary_weapon_slot_2 = bomb_locks
				fixed_auxiliary_weapon_slot_3 = empty
				engine_type_slot = engine_3_1x
				fixed_auxiliary_weapon_slot_5 = lmg_defense_turret
				special_type_slot_2 = dive_brakes_small
				special_type_slot_3 = armor_plate_small
				special_type_slot_4 = drop_tanks
				special_type_slot_5 = self_sealing_fuel_tanks_small	
				special_type_slot_6 = empty	
			}
		icon = "GFX_ITA_CAS2_medium"
	}
}
WNG_add_ro58_template = {
	create_equipment_variant = {
		name = "Ro.58"
		type = small_plane_airframe_2
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = aircraft_nose_cannon_1_2x
				fixed_auxiliary_weapon_slot_1 = aircraft_nose_cannon_1_2x
				fixed_auxiliary_weapon_slot_2 = aircraft_cannon_1_1x
				fixed_auxiliary_weapon_slot_6 = hmg_defense_turret
				engine_type_slot = engine_3_2x
				special_type_slot_1 = fuel_tanks_small
				fixed_auxiliary_weapon_slot_6 = hmg_defense_turret
				special_type_slot_7 = supercharger
			}
		icon = "GFX_ITA_heavy_fighter2_medium"
	}
}
WNG_add_p108_template = {
	create_equipment_variant = {
		name = "P.108"
		type = large_plane_airframe_2
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = large_bomb_bay
				fixed_auxiliary_weapon_slot_1 = large_bomb_bay
				fixed_auxiliary_weapon_slot_5 = hmg_defense_turret_2x
				fixed_auxiliary_weapon_slot_6 = hmg_defense_turret_2x
				fixed_auxiliary_weapon_slot_7 = lmg_defense_turret_2x
				engine_type_slot = radial_engine_3_4x
				special_type_slot_1 = NACA_cowling
				special_type_slot_7 = supercharger
			}
		icon = "GFX_ITA_strategic_bomber3_medium"
	}
}
WNG_add_CANT_Z511_template = {
	create_equipment_variant = {
		name = "CANT Z.511"
		type = large_plane_maritime_patrol_plane_airframe_2
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = torpedo_mounting
				fixed_auxiliary_weapon_slot_1 = torpedo_mounting
				#fixed_auxiliary_weapon_slot_2 = torpedo_mounting #Removed due to thrust/weight issues
				fixed_auxiliary_weapon_slot_3 = large_bomb_bay
				fixed_auxiliary_weapon_slot_5 = hmg_defense_turret
				fixed_auxiliary_weapon_slot_6 = hmg_defense_turret
				fixed_auxiliary_weapon_slot_7 = hmg_defense_turret_2x
				fixed_auxiliary_weapon_slot_8 = hmg_defense_turret_2x
				special_type_slot_4 = flying_boat_large
				engine_type_slot = radial_engine_3_4x
				special_type_slot_1 = NACA_cowling
				special_type_slot_7 = supercharger

			}
		icon = "GFX_ITA_strategic_bomber1_medium"
	}
}
WNG_add_CANT_Z506_template = {
	create_equipment_variant = {
		name = "CANT Z.506"
		type = medium_plane_airframe_2
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = medium_bomb_bay
				fixed_auxiliary_weapon_slot_1 = torpedo_mounting
				fixed_auxiliary_weapon_slot_5 = hmg_defense_turret
				engine_type_slot = engine_1_3x
				special_type_slot_1 = flying_boat_medium
				special_type_slot_7 = normally_aspirated_engine
			}
		icon = "GFX_ITA_fighter2_medium"
	}
}
WNG_add_ca311_template = {
	create_equipment_variant = {
		name = "Ca.311"
		type = small_plane_cas_airframe_1
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = bomb_locks
				fixed_auxiliary_weapon_slot_1 = light_mg_2x
				fixed_auxiliary_weapon_slot_6 = lmg_defense_turret
				engine_type_slot = engine_1_2x
				special_type_slot_1 = empty
				special_type_slot_2 = armor_plate_small
				special_type_slot_7 = normally_aspirated_engine
				special_type_slot_8 = canopy1
			}
		icon = "GFX_ITA_fighter3_medium"
	}
}
WNG_add_sm84_template = {
	create_equipment_variant = {
		name = "SM.84"
		type = medium_plane_airframe_2
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = medium_bomb_bay
				fixed_auxiliary_weapon_slot_1 = torpedo_mounting
				fixed_auxiliary_weapon_slot_2 = torpedo_mounting
				fixed_auxiliary_weapon_slot_5 = hmg_defense_turret_2x
				fixed_auxiliary_weapon_slot_6 = hmg_defense_turret_2x
				engine_type_slot = engine_3_3x #Increased tier due to thrust/weight issues
				special_type_slot_1 = armor_plate_medium
				special_type_slot_2 = empty
				special_type_slot_3 = empty
				special_type_slot_7 = normally_aspirated_engine
			}
		icon = "GFX_ITA_tactical_bomber2_medium"
	}
}
WNG_add_campini_n1_template = {
	create_equipment_variant = {
		name = "Campini N.1"
		type = small_plane_airframe_4
		parent_version = 0
		modules = {
				fixed_main_weapon_slot = aircraft_nose_cannon_2_2x
				fixed_auxiliary_weapon_slot_1 = aircraft_nose_cannon_2_2x
				engine_type_slot = jet_engine_1x
				special_type_slot_1 = armor_plate_small
				special_type_slot_2 = self_sealing_fuel_tanks_small
				special_type_slot_7 = compressor
				special_type_slot_8 = canopy2
			}
		icon = "GFX_ITA_jet_plane_1_medium"
	}
}