political_actions = {

	
	targeted_race_for_the_bomb = {

		icon = generic_research

		allowed = {
			always = yes
		}

		available = {
			#Target is FROM
			has_tech = atomic_research
			NOT = { has_global_flag = first_nuke_dropped }
			NOT = { has_idea = race_for_the_bomb }
		}

		target_root_trigger = {
            has_tech = atomic_research
            NOT = { has_global_flag = first_nuke_dropped }
            NOT = { has_idea = race_for_the_bomb }
		}

		#If this trigger matches a country.
		target_trigger = {
			#Target is FROM
			FROM = {
        		NOT = { is_in_faction_with = ROOT }
				is_special_project_completed = sp:sp_nuclear_reactor
				any_owned_state = {
					nuclear_reactor > 0
				}
			}
		}

		visible = {
            #Target is FROM
            has_tech = atomic_research
            NOT = { has_global_flag = first_nuke_dropped }
            NOT = { has_idea = race_for_the_bomb }
            FROM = {
        		NOT = { is_in_faction_with = ROOT }
				is_special_project_completed = sp:sp_nuclear_reactor
				any_owned_state = {
					nuclear_reactor > 0
				}
			}
		}

		complete_effect = {
			set_country_flag = racing_for_the_bomb
			add_ideas = race_for_the_bomb
		}

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				any_other_country = { is_special_project_completed = sp:sp_nuclear_bomb }
			}
		}
	}

	improved_worker_conditions = {

		icon = generic_industry
		priority = 10
		available = {
			has_stability < 1.0
			if = {
				limit = {
					tag = SPR
				}
				NOT = {
					has_idea = SPR_political_violence
				}
			}
		}

		visible = {
			always = yes
		}

		fire_only_once = no

		modifier = {
			stability_weekly = 0.005
			consumer_goods_factor = 0.10
			industrial_capacity_factory = -0.1
			
		}

		days_remove = 180
		days_re_enable = 540

		cost = 100

		complete_effect = {

		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 1
				has_stability < 0.6
				has_political_power > 155 #Spend on other things first
			}
			modifier = {
				factor = 0
				original_tag = SPR
				NOT = { has_global_flag = spanish_civil_war }
			}
			modifier = {
				factor = 0 
				tag = ICE
				has_completed_focus = ICE_not_our_king
				NOT = { has_completed_focus = ICE_break_with_the_crown }
			}
			modifier = {
				factor = 0 
				tag = GER
				has_completed_focus = GER_oppose_hitler_ww
				NOT = { 
					OR = {
						has_completed_focus = GER_the_peoples_victory 
						has_completed_focus = GER_monarchist_sentiment 
					}
				}
			}
			modifier = {
				add = 1000
				has_stability < 0.76
				original_tag = SWE
				has_idea = SWE_hungershield
			}
		}
	}
}

operations = {
	#MTG_TEST_NAVAL_MIXED_VS_MIXED_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
	#	name = "TEST: Mix vs Mix"
	#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_MIXED_VS_MIXED_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_MIXED_VS_MIXED_EARLY_RED"
	#			add_fuel = 10000000
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#			set_stability = 1
	#			set_war_support = 1
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}
	#MTG_TEST_NAVAL_MIXED_VS_CV_MIXED_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
	#	name = "TEST: Mix vs Mix (with CVs)"
	#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_MIXED_VS_MIXED_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_CV_MIXED_VS_CV_MIXED_EARLY_RED"
	#			add_fuel = 10000000
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#			set_stability = 1
	#			set_war_support = 1
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}
	#MTG_TEST_NAVAL_MIXED_VS_MIXED_SUBS_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
	#	name = "TEST: Mix vs Mix (with subs)"
#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	modifier = {
	#		navy_fuel_consumption_factor = -1
	#	}
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_MIXED_VS_MIXED_SUBS_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_MIXED_VS_MIXED_SUBS_EARLY_RED"
	#			add_fuel = 10000000
	#			set_stability = 1
	#			set_war_support = 1
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}
	#MTG_TEST_NAVAL_SCREENS_VS_MIXED_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
	#	name = "TEST: Screens vs Mix"
#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_battlecruiser = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_SCREENS_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_battlecruiser = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_MIXED_VS_MIXED_EARLY_RED"
	#			add_fuel = 10000000
	#			set_stability = 1
	#			set_war_support = 1
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}
	#MTG_TEST_NAVAL_SCREENS_VS_CV_MIXED_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
	#	name = "TEST: Screens vs Mix (with CV)"
#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_battlecruiser = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_SCREENS_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_battlecruiser = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_CV_MIXED_VS_CV_MIXED_EARLY_RED"
	#			add_fuel = 10000000
	#			set_stability = 1
	#			set_war_support = 1
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}
	#MTG_TEST_NAVAL_SCREENS_VS_CAPITALS_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
	#	name = "TEST: Screens vs Capitals"
#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_battlecruiser = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_SCREENS_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_battlecruiser = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_CAPITAL_EARLY_RED"
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#			add_fuel = 10000000
	#			set_stability = 1
	#			set_war_support = 1
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}
	#MTG_TEST_NAVAL_CAPITALS_VS_MIXED_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
	#	name = "TEST: Capitals vs Mix"
	#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_battlecruiser = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_CAPITAL_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_battlecruiser = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_MIXED_VS_MIXED_EARLY_RED"
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#			add_fuel = 10000000
	#			set_stability = 1
	#			set_war_support = 1
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}
	#MTG_TEST_NAVAL_CAPITALS_VS_CV_MIXED_EARLY = { #MTG_TODO_GABRIEL: remove before launch (no seriously do not ship with this (hehe get it don't SHIP with it)) 
#
	#	icon = generic
#
	#	name = "TEST: Capitals vs Mix (with CV)"
	#
	#	allowed = {
	#		tag = CUB
	#	}
#
	#	available = {
	#	
	#	}
	#
	#	cost = 0
	#	
	#	ai_will_do = {
	#		factor = 0
	#	}
	#	days_remove = -1
	#	complete_effect = {
	#		set_technology = {
	#			early_battleship = 1
	#			early_battlecruiser = 1
	#			early_heavy_cruiser = 1
	#			early_light_cruiser = 1
	#			early_destroyer = 1
	#			early_carrier = 1
	#			early_submarine = 1
	#			cv_fighter1 = 1
	#			cv_CAS1 = 1
	#			cv_naval_bomber1 = 1
	#		}
	#		load_oob = "MTG_NAVAL_TEST_OOB_CAPITAL_EARLY_BLUE"
	#		add_ideas = {
	#			MTG_TEST_NAVAL_IDEA
	#		}
	#		add_fuel = 10000000
	#		DOM = {
	#			set_technology = {
	#				early_battleship = 1
	#				early_battlecruiser = 1
	#				early_heavy_cruiser = 1
	#				early_light_cruiser = 1
	#				early_destroyer = 1
	#				early_carrier = 1
	#				early_submarine = 1
	#				cv_fighter1 = 1
	#				cv_CAS1 = 1
	#				cv_naval_bomber1 = 1
	#			}
	#			load_oob = "MTG_NAVAL_TEST_OOB_CV_MIXED_VS_CV_MIXED_EARLY_RED"
	#			add_ideas = {
	#				MTG_TEST_NAVAL_IDEA
	#			}
	#			add_fuel = 10000000
	#			set_stability = 1
	#			set_war_support = 1
	#		}
	#		declare_war_on = { target = DOM type = annex_everything }
	#		set_stability = 1
	#		set_war_support = 1
	#	}
	#}

	blow_suez_canal = {

		icon = GFX_decision_generic_ignite_civil_war
		allowed = {
			has_dlc = "Waking the Tiger"
		}
		available = {
			controls_state = 446
			controls_state = 453
			OR = {
				NOT = {
					owns_state = 446
					owns_state = 453
				}
				any_enemy_country = {
					OR = {
						controls_state = 452
						controls_state = 447
						controls_state = 456
						controls_state = 457
						controls_state = 454
						controls_state = 455
					}
				}
			}
		}
	
		visible = {
			has_war = yes
			NOT = { has_global_flag = SUEZ_CANAL_BLOCKED }
			any_controlled_state = {
				OR = {
					region = 28
					region = 128
				}
			}
		}
	
		fire_only_once = no
	
		days_remove = 30
	
		cost = 75
	
		modifier = {
			civilian_factory_use = 5
		}

		complete_effect = {
			hidden_effect = {
				if = {
					limit = {
						NOT = {
							owns_state = 446
							owns_state = 453
						}
					}
					random_country = {
						limit = {
							owns_state = 446
							owns_state = 453
						}
						country_event = { id = generic.12 days = 1 }
					}
				}
			}
		}
	
		remove_effect = {
			if = {
				limit = {
					OR = {
						has_full_control_of_state = 446
						has_full_control_of_state = 453
					}
				}
				set_country_flag = blew_up_suez
				set_global_flag = SUEZ_CANAL_BLOCKED
				country_event = { id = wtt_news.40 hours = 6}
			}
			effect_tooltip = {
				if = {
					limit = {
						ENG = {
							owns_state = 446
							owns_state = 453
						}
					}
					add_war_support = -0.05
					add_stability = -0.05
				}
			}
		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 200 # Try to cut the enemy off from the mediterranean if you also occupy Gibraltar
				OR = {
					has_full_control_of_state = 118
					any_allied_country = {
						has_full_control_of_state = 118
					}
				}
				has_war = yes
				NOT = { tag = ENG }
			}
			modifier = {
				add = 51 # Somewhat important if the baddies are coming
				446 = {
					OWNER = {
						OR = {
							tag = ROOT
							is_in_faction_with = ROOT
						}
					}
				}
				OR = {
					454 = {
						NOT = { controller = { tag = ROOT } }
						controller = { has_war_with = ROOT }
					}
					907 = {
						NOT = { controller = { tag = ROOT } }
						controller = { has_war_with = ROOT }
					}
					447 = {
						NOT = { controller = { tag = ROOT } }
						controller = { has_war_with = ROOT }
					}
				}
				has_war = yes
				is_in_faction_with = ENG
			}
		}
	}

	blow_panama_canal = {

		icon = GFX_decision_generic_ignite_civil_war
		allowed = {
			has_dlc = "Waking the Tiger"
			
		}
		available = {
			has_full_control_of_state = 685
		}
	
		visible = {
			has_war = yes
			NOT = { has_global_flag = PANAMA_CANAL_BLOCKED }
			any_controlled_state = {
				OR = {
					region = 34
					region = 124
				}
			}
		}
	
		fire_only_once = no
	
		days_remove = 30
	
		cost = 75
	
		modifier = {
			civilian_factory_use = 5
		}

		complete_effect = {
			hidden_effect = {
				if = {
					limit = {
						NOT = {
							owns_state = 685
						}
					}
					random_country = {
						limit = {
							owns_state = 685
						}
						country_event = { id = generic.13 days = 1 }
					}
				}
			}
		}
	
		remove_effect = {
			if = {
				limit = {
					OR = {
						has_full_control_of_state = 685
						has_full_control_of_state = 304
					}
				}
				set_country_flag = blew_up_panama
				set_global_flag = PANAMA_CANAL_BLOCKED
				country_event = { id = wtt_news.41 hours = 6}
			}
			effect_tooltip = {
				if = {
					limit = {
						USA = { owns_state = 685 }
					}
					add_war_support = -0.05
					add_stability = -0.05
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0 # Don't blow up the canal as USA. Ever.
				tag = USA
			}
			modifier = {
				factor = 0 # Don't blow up the canal if enemies have weak navies but you are a strong naval power
				has_navy_size = {
					size > 50
				}
				NOT = {
					any_enemy_country = {
						has_navy_size = {
							size > 50
						}
					}
				}
			}
			modifier = {
				factor = 200 # Always blow up the canal as JAP or GER when at war with USA (priority)
				OR = {
					is_in_faction_with = JAP
					is_in_faction_with = GER
				}
				has_war_with = USA
			}
		}
	}
}

special_projects = {

	rebuild_suez_canal = {

		icon = GFX_decision_generic_special_project

		available = {
			has_full_control_of_state = 446
			has_full_control_of_state = 453
			num_of_civilian_factories > 15
		}
	
		visible = {
			has_global_flag = SUEZ_CANAL_BLOCKED
		}
	
		fire_only_once = no
	
		days_remove = 365
	
		cost = 120
	
		modifier = {
			civilian_factory_use = 15
		}
	
		remove_effect = {
			if = {
				limit = {
					has_full_control_of_state = 446
					has_full_control_of_state = 453
				}
				set_country_flag = rebuilt_suez
				clr_global_flag = SUEZ_CANAL_BLOCKED
				country_event = { id = wtt_news.42 hours = 6}
			}
		}

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0 # Don't bother if your navy is weak AND not ENG
				has_navy_size = { size < 100 }
				NOT = { tag = ENG }
			}
			modifier = {
				factor = 200 # Prioritize if Italy is being invaded and you can't get to the battlefront (no control of Gibraltar strait)
				NOT = {
					OR = {
						has_full_control_of_state = 118
						any_allied_country = {
							has_full_control_of_state = 118
						}
					}
				}
				has_war_with = ITA
				ITA = { surrender_progress > 0.1 }
				has_full_control_of_state = 447
				has_full_control_of_state = 454
				has_full_control_of_state = 452
				has_full_control_of_state = 456
				has_full_control_of_state = 457
				NOT = { has_country_flag = blew_up_suez }
			}
			modifier = {
				factor = 200 # Prioritize if UK
				tag = ENG
			}
			modifier = {
				factor = 10 # Prioritize if not at war
				has_war = no
			}
		}
	}

	rebuild_panama_canal = {

		icon = GFX_decision_generic_special_project

		available = {
			has_full_control_of_state = 685
			NOT = {
				any_enemy_country = {
					controls_state = 304
				}
			}
			num_of_civilian_factories > 25
		}
	
		visible = {
			has_global_flag = PANAMA_CANAL_BLOCKED
		}
	
		fire_only_once = no
	
		days_remove = 180
	
		cost = 400
	
		modifier = {
			civilian_factory_use = 25
		}
	
		remove_effect = {
			if = {
				limit = {
					has_full_control_of_state = 685
					NOT = {
						any_enemy_country = {
							controls_state = 304
						}
					}
				}
				set_country_flag = rebuilt_panama
				clr_global_flag = PANAMA_CANAL_BLOCKED
				country_event = { id = wtt_news.43 hours = 6 }
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0 # Don't bother if your navy is weak AND not USA
				has_navy_size = { size < 50 }
				NOT = { tag = USA }
				has_war = yes
			}
			modifier = {
				factor = 200 # Prioritize if you decisively beat USA's navy
				has_war_with = USA
				USA = { has_navy_size = { size < 50 } }
				has_navy_size = { size > 100 }
			}
			modifier = {
				factor = 200 # Prioritize if USA
				tag = USA
			}
			modifier = {
				factor = 10 # Prioritize if not at war
				has_war = no
			}
		}
	}
}

war_measures = {
	
	emergency_factory_conversion_defensive = {

		icon = generic_industry

		available = {
			num_of_civilian_factories > 5 #Change this if amount of factories change
		}

		visible = {
			has_defensive_war = yes
			has_offensive_war = no
			num_of_controlled_states > 0			
		}

		fire_only_once = no

		days_re_enable = 90

		cost = 100

		complete_effect = {
			replace_civ_with_arms_factories = yes
			add_war_support = -0.05
		}
		ai_will_do = {
			factor = 0
		}
	}

	emergency_factory_conversion_offensive = {

		icon = generic_industry

		available = {
			num_of_civilian_factories > 5 #Change this if amount of factories change
		}

		visible = {
			has_offensive_war = yes
		}

		fire_only_once = no

		days_re_enable = 90

		cost = 100

		complete_effect = {
			replace_civ_with_arms_factories = yes
			add_war_support = -0.05
			add_stability = -0.03
		}
		ai_will_do = {
			factor = 0
		}
	}

	desperate_defense = {

		icon = generic_prepare_civil_war

		available = {
			surrender_progress > 0.5
		}

		visible = {
			surrender_progress > 0
		}

		fire_only_once = no

		days_remove = 45
		days_re_enable = 360

		cost = 50
		ai_will_do = {
			factor = 1
			modifier = {
				surrender_progress > 0.6
				factor = 10
			}
			modifier = {
				has_capitulated = yes
				factor = 0
			}
		}

		modifier = {
			defence = 0.2
			dig_in_speed_factor = 0.5
		}

		complete_effect = {

		}
	}

	women_in_the_workforce = {

		icon = generic_industry

        allowed = {
            always = yes
        }

        available = {
            has_war = yes
            if = {
				limit = {
					NOT = { original_tag = GER }
				}
        		has_idea = tot_economic_mobilisation
			}
			else_if = {
				limit = {
					original_tag = GER
				}
				OR = {
        			has_idea = tot_economic_mobilisation
					has_idea = totaler_krieg_economy
				}
				NOT = { has_completed_focus = GER_womens_rights_and_equality }
			}
            OR = {
                AND = {
                    has_government = russiandem
                    has_war_support > 0.79
                }
                AND = {
                    has_government = radicalsocialism
                    has_war_support > 0.79
                }
                AND = {
                    has_government = ordenstaat
                    OR = {
                        has_war_support > 0.89
                        surrender_progress > 0
                    }
                }
                AND = {
                    has_government = neutrality
                    has_war_support > 0.84
                    has_stability > 0.7
                }
            }
        }
        visible = {
            has_war = yes
            if = {
            	limit = {
            		original_tag = GER
            	}
            	NOT = { has_completed_focus = GER_womens_rights_and_equality }
            }
        }
        cost = 100
        days_remove = -1
        remove_trigger = {
            if = {
            	limit = {
            		original_tag = GER
            	}
        		OR = {
        			has_war = no
        			AND = {
        				NOT = { has_idea = tot_economic_mobilisation }
        				NOT = { has_idea = totaler_krieg_economy }
        			}
        			has_completed_focus = GER_womens_rights_and_equality
        		}
            }
        	else = {
	        	OR = {
	            	has_war = no
	            	NOT = { has_idea = tot_economic_mobilisation }
	            }
        	}
        }
        modifier = {
            conscription = 0.03
            stability_factor = -0.05
        }
        ai_will_do = {
			factor = 1

			modifier = {
				factor = 3
				has_manpower < 100000
			}
		}
		complete_effect = {
			if = {
				limit = {
					tag = CAN
				}
				country_event = { id = canada_vanilla.1 hours = 6 } # Ronnie the Bren Gun Girl
			}
        }
   }

    war_bonds = {

    	icon = generic_industry

    	allowed = {
            always = yes
        }

        available = {
            has_war = yes
            OR = {
                AND = {
                    has_government = russiandem
                    has_war_support > 0.79
                }
                AND = {
                    has_government = radicalsocialism
                    has_war_support > 0.79
                }
                AND = {
                    has_government = ordenstaat
                    OR = {
                        has_war_support > 0.89
                        surrender_progress > 0
                    }
                }
                AND = {
                    has_government = neutrality
                    has_war_support > 0.84
                    has_stability > 0.7
                }
            }
        }
        visible = {
            has_war = yes
            NOT = { tag = SPC }
        }

        fire_only_once = no

		days_remove = 180

		cost = GER_war_bonds_var?50

		modifier = {
			consumer_goods_factor = -0.20
		}

		ai_will_do = {
			factor = 1
			modifier = {
				has_political_power < 100
				factor = 0 #use as pp dump
			}

			modifier = {
				factor = 0
				original_tag = SOV
				SOV_save_pp_for_manpower_trouble = yes
			}
		}

		remove_effect = {

		}

		complete_effect = {
			if = {
				limit = {
					check_variable = {
						var = GER_war_bonds_var
						value = 50
						compare = less_than
					}
				}
				set_variable = {
					var = GER_war_bonds_var
					value = 50
				}
			}
			add_to_variable = {
				var = GER_war_bonds_var
				value = 25
			}
			if = {
				limit = {
					check_variable = {
						var = GER_war_bonds_var
						value = 100
						compare = greater_than_or_equals
					}
					check_variable = {
						var = GER_war_bonds_war_support_var
						value = -0.025
						compare = greater_than
					}
				}
				set_variable = {
					var = GER_war_bonds_war_support_var
					value = -0.025
				}
			}
			if = {
				limit = {
					check_variable = {
						var = GER_war_bonds_war_support_var
						value = -0.025
						compare = less_than_or_equals
					}
				}
				add_to_variable = {
					var = GER_war_bonds_war_support_var
					value = -0.025
				}
				add_war_support = GER_war_bonds_war_support_var
			}
		}
    }
	
	diversify_special_forces = {

		icon = GFX_decision_generic_military

		allowed = {
			has_dlc = "Arms Against Tyranny"
			NOT = {
				OR = {
					tag = ENG #has a focus
					tag = USA #has a focus
					tag = SOV #has a focus
					tag = JAP #has a focus
					tag = AST #has a focus
					tag = FRA #has a focus
					tag = GER #has a focus
				}
			}
		}

		available = {
		}

		visible = {
			is_major = yes
			date > 1940.1.1
			IF = {
				limit = {
					has_dlc = "Trial of Allegiance"
				}
				NOT = {
					OR = {
						tag = CHL #has a focus
						tag = BRA #has a focus
						tag = ARG #has a focus
						tag = URG #has a focus
						tag = PAR #has a focus
					}
				}
			}
			IF = {
				limit = {
					has_dlc = "Gotterdammerung"
				}
				NOT = {
					OR = {
						tag = BEL #has a focus
						tag = COG #has a focus
					}
				}
			}
		}

		fire_only_once = yes

		cost = 50

		complete_effect = {
			add_potential_special_forces_tree = yes
		}
		ai_will_do = {
			factor = 201
			modifier = {
				factor = 0
				is_major = no
			}
		}
	}
	
}

foreign_politics = {
	object_to_attaches = {

		allowed = {
            has_dlc = "Waking the Tiger"
        }

        cost = 50
        fire_only_once = no

        days_re_enable = 30

        available = {
        }

        visible = {
        	FROM = {
        		NOT = { has_country_flag = rejected_withdrawing_attache }
        		NOT = { has_country_flag = rejected_withdrawing_attache@ROOT }
        		NOT = { has_country_flag = object_attache_going_on }
        	}
        	has_war = yes
        	has_capitulated = no
        	NOT = { has_war_with = FROM }
        	any_enemy_country = {
				has_attache_from = FROM
			}
			NOT = {
				AND = {
					original_tag = SPR
					has_completed_focus = SPR_regional_defense_council_of_aragon
				}
			}
		}

		target_root_trigger = {
			has_war = yes
			has_capitulated = no
		}

		target_trigger = {
			NOT = { has_war_with = FROM }
			#FROM = { has_sent_attache = yes } # Make such trigger to optimize if it becomes a performance problem again.
			any_enemy_country = {
				has_attache_from = FROM
			}			
		}

        complete_effect = {
			FROM = { country_event = { id = generic.14 hours = 6 } }
			hidden_effect = {
				FROM = { set_country_flag = object_attache_going_on }
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
}

economy_decisions = {

	infrastructure_building_slot = {

		icon = generic_construction

        allowed = {
            always = yes
        }

        cost = 100
        fire_only_once = no

        days_re_enable = 30

		available = {
			any_owned_state = {
				NOT = { has_state_flag = infrastructure_building_slot_flag }
				is_fully_controlled_by = ROOT
				free_building_slots = {
					building = infrastructure
					size < 1
				}
			}
		}
	
		visible = {
			any_owned_state = {
				NOT = { has_state_flag = infrastructure_building_slot_flag }
				is_fully_controlled_by = ROOT
				free_building_slots = {
					building = infrastructure
					size < 1
				}
			}
		}

        complete_effect = {
			random_owned_state = {
				limit = {
					is_fully_controlled_by = ROOT
            		free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
					free_building_slots = {
						building = infrastructure
						size < 1
					}
					NOT = { has_state_flag = infrastructure_building_slot_flag }
				}
				add_extra_state_shared_building_slots = 1
				set_state_flag = infrastructure_building_slot_flag
			}
		}
		ai_will_do = {
			base = 1
			modifier = {
				factor = 1.5
				all_owned_state = { free_building_slots = { building = industrial_complex size < 1 include_locked = no } }
			}
		}
    }

    war_building_slot = {

    	icon = generic_construction

        allowed = {
            always = yes
        }

        cost = 50
        fire_only_once = no

        available = {
			IF = { 
				limit = { 
					OR = { 
						has_dlc = "Man the Guns" 	
						has_dlc = "By Blood Alone" 
					}
				}
				has_war_with_non_exiled_country = yes   
			}
			ELSE = {
				has_war = yes
			}
			any_owned_state = {
				NOT = { has_state_flag = war_building_slot_flag }
				is_fully_controlled_by = ROOT
			}
		}

        visible = {
			has_war = yes
			any_owned_state = {
				NOT = { has_state_flag = war_building_slot_flag }
				is_fully_controlled_by = ROOT
			}
		}

        complete_effect = {
        	add_war_support = -0.025
			add_stability = -0.025
			if = {
				limit = {
					any_owned_state = {
						is_fully_controlled_by = ROOT
            			free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
						NOT = { has_state_flag = war_building_slot_flag }
						infrastructure > 4
					}
				}
				random_owned_state = {
					limit = {
						is_fully_controlled_by = ROOT
            			free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
						NOT = { has_state_flag = war_building_slot_flag }
						infrastructure > 4
					}
					add_extra_state_shared_building_slots = 1
					set_state_flag = war_building_slot_flag
				}
			}
			else_if = {
				limit = {
					any_owned_state = {
						is_fully_controlled_by = ROOT
            			free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
						NOT = { has_state_flag = war_building_slot_flag }
						infrastructure > 2
					}
				}
				random_owned_state = {
					limit = {
						is_fully_controlled_by = ROOT
            			free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
						NOT = { has_state_flag = war_building_slot_flag }
						infrastructure > 2
					}
					add_extra_state_shared_building_slots = 1
					set_state_flag = war_building_slot_flag
				}
			}
			else = {
				random_owned_state = {
					limit = {
						is_fully_controlled_by = ROOT
            			free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
						NOT = { has_state_flag = war_building_slot_flag }
						infrastructure > 4
					}
					add_extra_state_shared_building_slots = 1
					set_state_flag = war_building_slot_flag
				}
			}
		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 1
				all_owned_state = { free_building_slots = { building = industrial_complex size < 1 include_locked = no } }
			}
		}
    }
}

foreign_support = {

###  #  # ###  #   #  ##      ###   ##   ##  ###  
#  # #  # #  # ## ## #  #     #  # #  # #  # #  # 
###  #  # ###  # # # ####     ###  #  # #### #  # 
#  # #  # #  # #   # #  #     #  # #  # #  # #  # 
###   ##  #  # #   # #  #     #  #  ##  #  # ###  

	 ##  #    ##   ## ### 
	#  # #   #  # #   #   
	#    #   #  #  #  ##  
	#  # #   #  #   # #   
	 ##  ###  ##  ##  ### 

	CHI_close_burma_road = {

		allowed = {
			#Everyone
		}

		available = {
			OR = {
				AND = {
					288 = { #Burma
						has_state_flag = CHI_needed_for_burma_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_needed_for_burma_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_needed_for_burma_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
		}

		visible = {
			is_subject = no
			NOT = {
				OR = {
					has_subject = CHI
					has_war_with = CHI
				}
			}
			OR = {
				AND = {
					288 = { #Burma
						has_state_flag = CHI_needed_for_burma_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_needed_for_burma_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_needed_for_burma_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
			any_other_country = {
				check_variable = { CHI_burma_road_current_level > 0 }
				NOT = { is_in_faction_with = ROOT }
			}
		}

		fire_only_once = no

		cost = 0

		modifier = {

		}

		ai_will_do = {
			base = 1
			modifier = {
				factor = 0
				any_country = {
					check_variable = { CHI_burma_road_current_level > 0 }
					OR = {
						is_subject = no
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = { has_war_with = ROOT }
				}
			}
			modifier = {
				factor = 200
				any_country = {
					check_variable = { CHI_burma_road_current_level > 0 }
					OR = {
						has_war_with = ROOT
						AND = {
							is_subject = yes
							NOT = { is_subject_of = ROOT }
							NOT = { is_in_faction_with = ROOT }
						}
					}
				}
			}
		}

		complete_effect = {
			hidden_effect = {
				every_state = {
					limit = {
						has_state_flag = CHI_needed_for_burma_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
					set_state_flag = CHI_burma_road_closed_state
				}
			}
			random_country = {
				#Country that had the route
				limit = { check_variable = { CHI_burma_road_current_level > 0 } }
				hidden_effect = {					
					set_variable = { tempvar = 0 }
					subtract_from_variable = { var = tempvar value = CHI_burma_road_current_level }

					add_offsite_building = { type = arms_factory level = tempvar }
					#In case we need to reopen
					set_variable = { CHI_burma_road_closed_level = CHI_burma_road_current_level }
					set_variable = { CHI_burma_road_current_level = 0 }
					clear_variable = tempvar
				}
				country_event = { id = wtt_burma_road.2 }
				custom_effect_tooltip = close_burma_road_explanation # Prints the contents of the CHI_burma_road_current_level variable
			}
		}
	}

	###  ###  ##  ###  ### #  # 
	#  # #   #  # #  # #   ## # 
	###  ##  #  # ###  ##  # ## 
	#  # #   #  # #    #   #  # 
	#  # ###  ##  #    ### #  # 
	CHI_reopen_burma_road = {

		allowed = {
			#Everyone
		}

		available = {
			OR = {
				AND = {
					288 = { #Burma
						has_state_flag = CHI_burma_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								is_subject_of = ROOT
							}
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_burma_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								is_subject_of = ROOT
							}
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_burma_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								is_subject_of = ROOT
							}
						}
					}
				}
			}
		}

		visible = {
			is_subject = no
			NOT = {
				OR = {
					has_subject = CHI
					has_war_with = CHI
				}
			}
			OR = {
				AND = {
					288 = { #Burma
						has_state_flag = CHI_burma_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_burma_road_closed_level > 0 }
								}
							}
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_burma_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_burma_road_closed_level > 0 }
								}
							}
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_burma_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_burma_road_closed_level > 0 }
								}
							}
						}
					}
				}
			}
			any_country = {
				check_variable = { CHI_burma_road_closed_level > 0 }
				NOT = { has_war_with = ROOT }
			}
		}

		fire_only_once = no

		cost = 0

		modifier = {

		}

		ai_will_do = {
			base = 1
			modifier = {
				factor = 200
				any_country = {
					check_variable = { CHI_burma_road_closed_level > 0 }
					OR = {
						is_subject = no
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = { has_war_with = ROOT }
				}
			}
			modifier = {
				factor = 0
				any_country = {
					check_variable = { CHI_burma_road_closed_level > 0 }
					OR = {
						has_war_with = ROOT
						AND = {
							is_subject = yes
							NOT = { is_subject_of = ROOT }
							NOT = { is_in_faction_with = ROOT }
						}
					}
				}
			}
		}

		complete_effect = {
			every_state = {
				limit = {
					has_state_flag = CHI_burma_road_closed_state
					OR = {
						is_controlled_by = ROOT
						CONTROLLER = {
							OR = {
								is_subject_of = ROOT
								check_variable = { CHI_burma_road_closed_level > 0 }
							}
						}
					}
				}
				custom_effect_tooltip = CHI_burma_road_reopen_state
				clr_state_flag = CHI_burma_road_closed_state
			}

			random_country = {
				limit = { check_variable = { CHI_burma_road_closed_level > 0 } }
				if = {
					limit = {
						any_state = {
							has_state_flag = CHI_burma_road_closed_state							
							NOT = { is_controlled_by = ROOT }
							CONTROLLER = {
								NOT = { is_subject_of = ROOT }
								NOT = { check_variable = { CHI_burma_road_closed_level > 0 } }
							}
						}
					}
					country_event = { id = wtt_burma_road.3 } #We opened our part of the road
				}
				else = {
					#Road is fully reopened
					if = {
						limit = { NOT = { tag = ROOT } }
						country_event = { id = wtt_burma_road.4 }
					}
					hidden_effect = {					
						add_offsite_building = { type = arms_factory level = CHI_burma_road_closed_level }
						set_variable = { CHI_burma_road_current_level = CHI_burma_road_closed_level }
						clear_variable = CHI_burma_road_closed_level 
					}
					custom_effect_tooltip = reopen_burma_road_explanation # Prints the contents of the CHI_burma_road_closed_level variable
				}
			}
		}
	}

#   ### ###   ##      ###   ##   ##  ###  
#   #   #  # #  #     #  # #  # #  # #  # 
#   ##  #  # #  #     ###  #  # #### #  # 
#   #   #  # #  #     #  # #  # #  # #  # 
### ### ###   ##      #  #  ##  #  # ###  
	

	 ##  #    ##   ## ### 
	#  # #   #  # #   #   
	#    #   #  #  #  ##  
	#  # #   #  #   # #   
	 ##  ###  ##  ##  ### 

	CHI_close_ledo_road = {

		allowed = {
			#Everyone
		}

		available = {
			OR = {
				AND = {
					432 = { #Assam
						has_state_flag = CHI_needed_for_ledo_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_needed_for_ledo_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_needed_for_ledo_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}			
		}

		visible = {
			is_subject = no
			NOT = {
				OR = {
					has_subject = CHI
					has_war_with = CHI
				}
			}
			OR = {
				AND = {
					432 = { #Assam
						has_state_flag = CHI_needed_for_ledo_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_needed_for_ledo_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_needed_for_ledo_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
			any_other_country = {
				check_variable = { CHI_ledo_road_current_level > 0 }
				NOT = { is_in_faction_with = ROOT }
			}
		}

		fire_only_once = no

		cost = 0

		modifier = {

		}

		ai_will_do = {
			base = 1
			modifier = {
				factor = 0
				any_country = {
					check_variable = { CHI_ledo_road_current_level > 0 }
					OR = {
						is_subject = no
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = { has_war_with = ROOT }
				}
			}
			modifier = {
				factor = 200
				any_country = {
					check_variable = { CHI_ledo_road_current_level > 0 }
					OR = {
						has_war_with = ROOT
						AND = {
							is_subject = yes
							NOT = { is_subject_of = ROOT }
							NOT = { is_in_faction_with = ROOT }
						}
					}
				}
			}
		}

		complete_effect = {
			hidden_effect = {
				every_state = {
					limit = {
						has_state_flag = CHI_needed_for_ledo_road
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
					set_state_flag = CHI_ledo_road_closed_state
				}
			}
			random_country = {
				#Country that had the route
				limit = { check_variable = { CHI_ledo_road_current_level > 0 } }
				hidden_effect = {					
					set_variable = { tempvar = 0 }
					subtract_from_variable = { var = tempvar value = CHI_ledo_road_current_level }

					add_offsite_building = { type = arms_factory level = tempvar }
					#In case we need to reopen
					set_variable = { CHI_ledo_road_closed_level = CHI_ledo_road_current_level }
					set_variable = { CHI_ledo_road_current_level = 0 }
					clear_variable = tempvar
				}
				country_event = { id = wtt_ledo_road.2 }
				custom_effect_tooltip = close_ledo_road_explanation # Prints the contents of the CHI_ledo_road_current_level variable
			}
		}
	}

	###  ###  ##  ###  ### #  # 
	#  # #   #  # #  # #   ## # 
	###  ##  #  # ###  ##  # ## 
	#  # #   #  # #    #   #  # 
	#  # ###  ##  #    ### #  # 
	CHI_reopen_ledo_road = {

		allowed = {
			#Everyone
		}

		available = {
			OR = {
				AND = {
					432 = { #Assam
						has_state_flag = CHI_ledo_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								is_subject_of = ROOT
							}
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_ledo_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								is_subject_of = ROOT
							}
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_ledo_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								is_subject_of = ROOT
							}
						}
					}
				}
			}
		}

		visible = {
			is_subject = no
			NOT = {
				OR = {
					has_subject = CHI
					has_war_with = CHI
				}
			}
			OR = {
				AND = {
					432 = { #Assam
						has_state_flag = CHI_ledo_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_ledo_road_closed_level > 0 }
								}
							}
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_ledo_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_ledo_road_closed_level > 0 }
								}
							}
						}
					}
				}
				AND = {
					640 = { #Mandalay
						has_state_flag = CHI_ledo_road_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_ledo_road_closed_level > 0 }
								}
							}
						}
					}
				}
			}
			any_country = {
				check_variable = { CHI_ledo_road_closed_level > 0 }
				NOT = { has_war_with = ROOT }
			}
			any_state = {
				has_state_flag = CHI_ledo_road_closed_state
				OR = {
					is_controlled_by = ROOT
					CONTROLLER = {
						OR = {
							is_subject_of = ROOT
							check_variable = { CHI_ledo_road_closed_level > 0 }
						}
					}
				}
			}
		}

		fire_only_once = no

		cost = 0

		modifier = {

		}

		ai_will_do = {
			base = 1
			modifier = {
				factor = 200
				any_country = {
					check_variable = { CHI_ledo_road_closed_level > 0 }
					OR = {
						is_subject = no
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = { has_war_with = ROOT }
				}
			}
			modifier = {
				factor = 0
				any_country = {
					check_variable = { CHI_ledo_road_closed_level > 0 }
					OR = {
						has_war_with = ROOT
						AND = {
							is_subject = yes
							NOT = { is_subject_of = ROOT }
							NOT = { is_in_faction_with = ROOT }
						}
					}
				}
			}
		}

		complete_effect = {
			every_state = {
				limit = {
					has_state_flag = CHI_ledo_road_closed_state
					OR = {
						is_controlled_by = ROOT
						CONTROLLER = {
							OR = {
								is_subject_of = ROOT
								check_variable = { CHI_ledo_road_closed_level > 0 }
							}
						}
					}
				}
				custom_effect_tooltip = CHI_ledo_road_reopen_state
				clr_state_flag = CHI_ledo_road_closed_state
			}

			random_country = {
				limit = { check_variable = { CHI_ledo_road_closed_level > 0 } }
				if = {
					limit = {
						any_state = {
							has_state_flag = CHI_ledo_road_closed_state							
							NOT = { is_controlled_by = ROOT }
							CONTROLLER = {
								NOT = { is_subject_of = ROOT }
								NOT = { check_variable = { CHI_ledo_road_closed_level > 0 } }
							}
						}
					}
					country_event = { id = wtt_ledo_road.3 } #We opened our part of the road
				}
				else = {
					#Road is fully reopened
					if = {
						limit = { NOT = { tag = ROOT } }
						country_event = { id = wtt_ledo_road.4 }
					}
					hidden_effect = {					
						add_offsite_building = { type = arms_factory level = CHI_ledo_road_closed_level }
						set_variable = { CHI_ledo_road_current_level = CHI_ledo_road_closed_level }
						clear_variable = CHI_ledo_road_closed_level
					}
					custom_effect_tooltip = reopen_ledo_road_explanation # Prints the contents of the CHI_ledo_road_closed_level variable
				}
			}
		}
	}

### #  # ###     #  # #  # #   # ###  
 #  #  # #       #  # #  # ## ## #  # 
 #  #### ##      #### #  # # # # ###  
 #  #  # #       #  # #  # #   # #    
 #  #  # ###     #  #  ##  #   # #

	 ##  #    ##   ## ### 
	#  # #   #  # #   #   
	#    #   #  #  #  ##  
	#  # #   #  #   # #   
	 ##  ###  ##  ##  ### 
 	CHI_close_the_hump = {

 		allowed = {
 			#Everyone
 		}

 		available = {
			OR = {
				AND = {
					434 = { #Arunachal Pradesh
						has_state_flag = CHI_needed_for_the_hump
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					601 = { #Xikang
						has_state_flag = CHI_needed_for_the_hump
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
 		}

 		visible = {
 			is_subject = no
 			NOT = {
 				OR = {
 					has_subject = CHI
 					has_war_with = CHI
 				}
 			}
			OR = {
				AND = {
					434 = { #Arunachal Pradesh
						has_state_flag = CHI_needed_for_the_hump
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					601 = { #Xikang
						has_state_flag = CHI_needed_for_the_hump
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
 			any_other_country = {
 				check_variable = { CHI_the_hump_current_level > 0 }
 				NOT = { is_in_faction_with = ROOT }
 			}
 		}

 		fire_only_once = no

 		cost = 0

 		modifier = {

 		}

 		ai_will_do = {
 			base = 1
			modifier = {
				factor = 0
				any_country = {
					check_variable = { CHI_the_hump_current_level > 0 }
					OR = {
						is_subject = no
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = { has_war_with = ROOT }
				}
			}
			modifier = {
				factor = 200
				any_country = {
					check_variable = { CHI_the_hump_current_level > 0 }
					OR = {
						has_war_with = ROOT
						AND = {
							is_subject = yes
							NOT = { is_subject_of = ROOT }
							NOT = { is_in_faction_with = ROOT }
						}
					}
				}
			}
 		}

 		complete_effect = {
 			hidden_effect = {
 				every_state = {
 					limit = {
 						has_state_flag = CHI_needed_for_the_hump
 						OR = {
 							is_controlled_by = ROOT
 							CONTROLLER = { is_subject_of = ROOT }
 						}
 					}
 					set_state_flag = CHI_the_hump_closed_state
 				}
 			}
 			random_country = {
 				#Country that had the route
 				limit = { check_variable = { CHI_the_hump_current_level > 0 } }
 				hidden_effect = {					
 					set_variable = { tempvar = 0 }
 					subtract_from_variable = { var = tempvar value = CHI_the_hump_current_level }

 					add_offsite_building = { type = arms_factory level = tempvar }
 					#In case we need to reopen
 					set_variable = { CHI_the_hump_closed_level = CHI_the_hump_current_level }
 					set_variable = { CHI_the_hump_current_level = 0 }
 					clear_variable = tempvar
 				}
 				country_event = { id = wtt_the_hump.2 }
				custom_effect_tooltip = close_the_hump_explanation # Prints the contents of the CHI_the_hump_current_level variable
 			}
 		}
 	}

 	###  ###  ##  ###  ### #  # 
 	#  # #   #  # #  # #   ## # 
 	###  ##  #  # ###  ##  # ## 
 	#  # #   #  # #    #   #  # 
 	#  # ###  ##  #    ### #  # 
 	CHI_reopen_the_hump = {

 		allowed = {
 			#Everyone
 		}

 		available = {
			OR = {
				AND = {
					434 = { #Arunachal Pradesh
						has_state_flag = CHI_the_hump_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					601 = { #Xikang
						has_state_flag = CHI_the_hump_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
 		}

 		visible = {
 			is_subject = no
 			NOT = {
 				OR = {
 					has_subject = CHI
 					has_war_with = CHI
 				}
 			}
			OR = {
				AND = {
					434 = { #Arunachal Pradesh
						has_state_flag = CHI_the_hump_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_the_hump_closed_level > 0 }
								}
							}
						}
					}
				}
				AND = {
					601 = { #Xikang
						has_state_flag = CHI_the_hump_closed_state
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = {
								OR = {
									is_subject_of = ROOT
									check_variable = { CHI_the_hump_closed_level > 0 }
								}
							}
						}
					}
				}
			}
 			any_country = {
 				check_variable = { CHI_the_hump_closed_level > 0 }
 				NOT = { has_war_with = ROOT }
 			}
 		}

 		fire_only_once = no

 		cost = 0

 		modifier = {

 		}

 		ai_will_do = {
 			base = 1
			modifier = {
				factor = 200
				any_country = {
					check_variable = { CHI_the_hump_closed_level > 0 }
					OR = {
						is_subject = no
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = { has_war_with = ROOT }
				}
			}
			modifier = {
				factor = 0
				any_country = {
					check_variable = { CHI_the_hump_closed_level > 0 }
					OR = {
						has_war_with = ROOT
						AND = {
							is_subject = yes
							NOT = { is_subject_of = ROOT }
							NOT = { is_in_faction_with = ROOT }
						}
					}
				}
			}
 		}

 		complete_effect = {
 			every_state = {
 				limit = {
 					has_state_flag = CHI_the_hump_closed_state
 					OR = {
 						is_controlled_by = ROOT
 						CONTROLLER = {
 							OR = {
 								is_subject_of = ROOT
 								check_variable = { CHI_the_hump_closed_level > 0 }
 							}
 						}
 					}
 				}
 				custom_effect_tooltip = CHI_the_hump_reopen_state
 				clr_state_flag = CHI_the_hump_closed_state
 			}

 			random_country = {
 				limit = { check_variable = { CHI_the_hump_closed_level > 0 } }
 				if = {
 					limit = {
 						any_state = {
 							has_state_flag = CHI_the_hump_closed_state							
 							NOT = { is_controlled_by = ROOT }
 							CONTROLLER = {
 								NOT = { is_subject_of = ROOT }
 								NOT = { check_variable = { CHI_the_hump_closed_level > 0 } }
 							}
 						}
 					}
 					country_event = { id = wtt_the_hump.3 } #We opened our part of the road
 				}
 				else = {
 					#Road is fully reopened
 					if = {
 						limit = { NOT = { tag = ROOT } }
 						country_event = { id = wtt_the_hump.4 }
 					}
 					hidden_effect = {					
 						add_offsite_building = { type = arms_factory level = CHI_the_hump_closed_level }
 						set_variable = { CHI_the_hump_current_level = CHI_the_hump_closed_level }
 						clear_variable = CHI_the_hump_closed_level
 					}
					custom_effect_tooltip = reopen_the_hump_explanation # Prints the contents of the CHI_the_hump_closed_level variable
 				}
 			}
 		}
 	}


#  #  ##  #  #  ##  ###     ###   ##  #  # ### ### 
#  # #  # ## # #  #  #      #  # #  # #  #  #  #   
#### #### # ## #  #  #      ###  #  # #  #  #  ##  
#  # #  # #  # #  #  #      #  # #  # #  #  #  #   
#  # #  # #  #  ##  ###     #  #  ##   ##   #  ### 

	 ##  #    ##   ## ### 
	#  # #   #  # #   #   
	#    #   #  #  #  ##  
	#  # #   #  #   # #   
	 ##  ###  ##  ##  ### 

	CHI_close_hanoi_route = {

		allowed = {
			#Everyone
		}

		available = {
			OR = {
				AND = {
					671 = { #Tonkin
						has_state_flag = CHI_needed_for_hanoi_route
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_needed_for_hanoi_route
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
		}

		visible = {
			is_subject = no
			NOT = {
				OR = {
					has_subject = CHI
					has_war_with = CHI
				}
			}
			OR = {
				AND = {
					671 = { #Tonkin
						has_state_flag = CHI_needed_for_hanoi_route
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
				AND = {
					325 = { #Yunnan
						has_state_flag = CHI_needed_for_hanoi_route
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
				}
			}
			any_other_country = {
				check_variable = { CHI_hanoi_route_current_level > 0 }
				NOT = { is_in_faction_with = ROOT }
			}
		}

		fire_only_once = no

		cost = 0

		modifier = {

		}

		ai_will_do = {
			base = 1
			modifier = {
				factor = 0
				any_country = {
					check_variable = { CHI_hanoi_route_current_level > 0 }
					OR = {
						is_subject = no
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = { has_war_with = ROOT }
				}
			}
			modifier = {
				factor = 200
				any_country = {
					check_variable = { CHI_hanoi_route_current_level > 0 }
					OR = {
						has_war_with = ROOT
						AND = {
							is_subject = yes
							NOT = { is_subject_of = ROOT }
							NOT = { is_in_faction_with = ROOT }
						}
					}
				}
			}
		}

		complete_effect = {
			hidden_effect = {
				every_state = {
					limit = {
						has_state_flag = CHI_needed_for_hanoi_route
						OR = {
							is_controlled_by = ROOT
							CONTROLLER = { is_subject_of = ROOT }
						}
					}
					set_state_flag = CHI_hanoi_route_closed_state
				}
			}
			random_country = {
				#Country that had the route
				limit = { check_variable = { CHI_hanoi_route_current_level > 0 } }
				hidden_effect = {					
					set_variable = { tempvar = 0 }
					subtract_from_variable = { var = tempvar value = CHI_hanoi_route_current_level }

					add_offsite_building = { type = arms_factory level = tempvar }
					#In case we need to reopen
					set_variable = { CHI_hanoi_route_closed_level = CHI_hanoi_route_current_level }
					set_variable = { CHI_hanoi_route_current_level = 0 }
					clear_variable = tempvar
				}
				country_event = { id = wtt_hanoi_route.2 }
				custom_effect_tooltip = close_hanoi_route_explanation # Prints the contents of the CHI_hanoi_route_current_level variable
			}
		}
	}
}

generic_purchase_old_ships_category = {
	purchase_ships_eng = {
		cost = 50
		icon = GFX_decision_generic_naval
		fire_only_once = no
		visible = {
			has_country_flag = generic_purchase_old_ships_flag
			ENG = { 
				NOT = { 
					has_country_flag = sold_ships_to_us@ROOT
					has_country_flag = negotiating_ship_purchase_flag@ROOT 
				}
			}
			NOT = { has_war_with = ENG}
		}
		available = {
			NOT = {
				ENG = {
					OR = {
						has_civil_war = yes
						has_capitulated = yes
						has_opinion = {
							target = FROM
							value < 30
						}
					}					
				}
			}
			
		}
		days_remove = 14
		remove_effect = {
			ENG = {
				country_event = {
					id = generic_purchase_ships_events.01
					hours = 1
				}
				set_country_flag = negotiating_ship_purchase_flag@ROOT
			}			
		}
	}
	purchase_ships_sov = {
		cost = 50
		icon = GFX_decision_generic_naval
		fire_only_once = no
		visible = {
			has_country_flag = generic_purchase_old_ships_flag
			SOV = { 
					has_country_flag = sold_ships_to_us@ROOT
					has_country_flag = negotiating_ship_purchase_flag@ROOT 
			}

			NOT = { has_war_with = SOV}
		}
		available = {
			NOT = {
				SOV = {
					OR = {
						has_civil_war = yes
						has_capitulated = yes
						has_opinion = {
							target = FROM
							value < 30
						}
					}					
				}
			}
			
		}
		days_remove = 14
		remove_effect = {
			SOV = {
				country_event = {
					id = generic_purchase_ships_events.01
					hours = 1
				}
				set_country_flag = negotiating_ship_purchase_flag@ROOT
			}
		}
	}
	purchase_ships_ger = {
		cost = 50
		icon = GFX_decision_generic_naval
		fire_only_once = no
		visible = {
			has_country_flag = generic_purchase_old_ships_flag
			GER = { 
				NOT = { 
					has_country_flag = sold_ships_to_us@ROOT
					has_country_flag = negotiating_ship_purchase_flag@ROOT
				}

			}
			NOT = { has_war_with = GER}
		}
		available = {
			NOT = {
				GER = {
					OR = {
						has_civil_war = yes
						has_capitulated = yes
						has_opinion = {
							target = FROM
							value < 30
						}
					}					
				}
			}
			
		}
		days_remove = 14
		remove_effect = {
			GER = {
				country_event = {
					id = generic_purchase_ships_events.01
					hours = 1
				}
				set_country_flag = negotiating_ship_purchase_flag@ROOT
			}
		}
	}
	purchase_ships_usa = {
		cost = 50
		icon = GFX_decision_generic_naval
		fire_only_once = no
		visible = {
			has_country_flag = generic_purchase_old_ships_flag
			USA = { 
				NOT = { 
					has_country_flag = sold_ships_to_us@ROOT
					has_country_flag = negotiating_ship_purchase_flag@ROOT  
				}
			}
			NOT = { has_war_with = USA}
		}
		available = {
			NOT = {
				USA = {
					OR = {
						has_civil_war = yes
						has_capitulated = yes
						has_opinion = {
							target = FROM
							value < 30
						}
					}					
				}
			}
			
		}
		days_remove = 14
		remove_effect = {
			USA = {
				country_event = {
					id = generic_purchase_ships_events.01
					hours = 1
				}
				set_country_flag = negotiating_ship_purchase_flag@ROOT
			}
		}
	}
}

generic_refit_civilian_ships_category = {
	refit_to_destroyer = {
		cost = 15
		icon = GFX_decision_generic_merge_plant_ship
		fire_only_once = no
		visible = {
			has_country_flag = refit_convoy_ships_flag
		}
		available = {	
			has_equipment = {
   				convoy > 9
	  		}	
	  		if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = early_ship_hull_light
			}
			else = {
				has_tech = early_destroyer
			}
		}
		days_remove = 50

		complete_effect = {
			add_equipment_to_stockpile = { 
				type = convoy_1
				amount = -10 

			}
		}
		remove_effect = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				if = {
					limit = {
						NOT = {	has_country_flag = refit_to_destroyer_flag } #FIN gets flag along with Ship variants via the focus that unlocks these decisions
					}			
					set_country_flag = refit_to_destroyer_flag
	
					create_equipment_variant = {	
						name = "Refitted Destroyer Class" 		
						type = ship_hull_light_1
						name_group = "DEN_DD_HISTORICAL" #Note: Doesn't matter if ROOT is not DEN, the effect will grab the appropriate country-specific name list anyways
						parent_version = 0
						modules = {
							fixed_ship_battery_slot = ship_light_battery_1
							fixed_ship_anti_air_slot = ship_anti_air_1
							fixed_ship_fire_control_system_slot = ship_fire_control_system_0
							fixed_ship_radar_slot = empty
							fixed_ship_engine_slot = light_ship_engine_1
							fixed_ship_torpedo_slot = ship_torpedo_1
							mid_1_custom_slot = empty
							rear_1_custom_slot = empty
						}
						obsolete = yes
					}
				}
				create_ship = {
					type = ship_hull_light_1
					equipment_variant = "Refitted Destroyer Class"
					creator = ROOT
					name = "Coastguard"
				}
			}
			#NO MTG
			else = {
				if = {
					limit = {
						NOT = {	has_country_flag = refit_to_destroyer_flag }
					}			
					set_country_flag = refit_to_destroyer_flag

					create_equipment_variant = {
						name = "Refitted Destroyer Class"
						type = destroyer_1
						upgrades = {
							ship_torpedo_upgrade = 0
							destroyer_engine_upgrade = 0
							ship_ASW_upgrade = 0
							ship_anti_air_upgrade = 0
						}
						obsolete = yes
					}
				}
				create_ship = {
					type = destroyer_1
					equipment_variant = "Refitted Destroyer Class"
					creator = ROOT
					name = "Coastguard"
				}		
			}
		}
	}
	refit_to_cruiser = {
		cost = 30
		icon = GFX_decision_generic_merge_plant_ship
		fire_only_once = no
		visible = {
			has_country_flag = refit_convoy_ships_flag
		}
		available = {	
			has_equipment = {
   				convoy > 19
	  		}
	  		if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = early_ship_hull_cruiser
			}
			else = {
				has_tech = early_light_cruiser
			}
		}
		days_remove = 100

		complete_effect = {
			add_equipment_to_stockpile = { 
				type = convoy_1
				amount = -25 
			}
		}
		remove_effect = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				if = {
					limit = {
						NOT = {	has_country_flag = refit_to_cruiser_flag } #FIN gets flag along with Ship variants via the focus that unlocks these decisions
					}			
					set_country_flag = refit_to_cruiser_flag
	
					create_equipment_variant = {
						name = "Refitted Cruiser Class"				
						type = ship_hull_cruiser_1
						name_group = DEN_CL_HISTORICAL #Note: Doesn't matter if ROOT is not DEN, the effect will grab the appropriate country-specific name list anyways
						parent_version = 0
						modules = {
							fixed_ship_battery_slot = ship_light_medium_battery_1
							fixed_ship_anti_air_slot = ship_anti_air_1
							fixed_ship_fire_control_system_slot = ship_fire_control_system_0
							fixed_ship_radar_slot = empty
							fixed_ship_engine_slot = cruiser_ship_engine_1
							fixed_ship_armor_slot = ship_armor_cruiser_1
							fixed_ship_secondaries_slot = dp_ship_secondaries_1
							mid_1_custom_slot = empty
							mid_2_custom_slot = empty
							rear_1_custom_slot = empty
						}
						obsolete = yes
					}
				}
				create_ship = {
					type = ship_hull_cruiser_1
					equipment_variant = "Refitted Cruiser Class"
					creator = ROOT
					name = "Protector"
				}
			}
			else = {
				if = {
					limit = {
						NOT = {	has_country_flag = refit_to_cruiser_flag }
					}			
					set_country_flag = refit_to_cruiser_flag

					create_equipment_variant = {
						name = "Refitted Cruiser Class"
						type = light_cruiser_1
						upgrades = {
							ship_reliability_upgrade = 0
							ship_engine_upgrade = 0
							ship_gun_upgrade = 0
							ship_anti_air_upgrade = 0
						}
						obsolete = yes
					}
				}
				create_ship = {
					type = light_cruiser_1
					equipment_variant = "Refitted Cruiser Class"
					creator = ROOT
					name = "Protector"
				}	
			}
		}
	}
}