### GCW EFFECTS ###

GER_GCW_select_victor = { #Used only in a purely AI GCW if the war has run on for too long

	#Meant to operate using a points based system, to attempt to gauge the prospective victor.

	#Speer
	if = {
		limit = { country_exists = SGR }
		SGR = {
			set_variable = { GCW_manpower = num_divisions }
			set_variable = { GCW_equipment = num_equipment_in_armies_k@infantry_equipment }
			set_variable = { GCW_surrender_progress = surrender_progress }
		}
	}
	#Bormann
	if = {
		limit = { country_exists = BGR }
		BGR = {
			set_variable = { GCW_manpower = num_divisions }
			set_variable = { GCW_equipment = num_equipment_in_armies_k@infantry_equipment }
			set_variable = { GCW_surrender_progress = surrender_progress }
		}
	}

	#Point distribution

	#Fielded divisions
	if = {
		limit = {
			check_variable = { SGR.GCW_manpower > BGR.GCW_manpower }
		}
		add_to_variable = { SGR_points = 1 }
	}
	else_if = {
		limit = {
			check_variable = { BGR.GCW_manpower > SGR.GCW_manpower }
		}
		add_to_variable = { BGR_points = 1 }
	}

	#Equipment
	if = {
		limit = {
			check_variable = { SGR.GCW_equipment > BGR.GCW_equipment }
		}
		add_to_variable = { SGR_points = 1 }
	}
	else_if = {
		limit = {
			check_variable = { BGR.GCW_equipment > SGR.GCW_equipment }
		}
		add_to_variable = { BGR_points = 1 }
	}

	#Surrender progress
	if = {
		limit = {
			check_variable = { SGR.GCW_surrender_progress < BGR.GCW_surrender_progress }
		}
		add_to_variable = { SGR_points = 1 }
	}
	else_if = {
		limit = {
			check_variable = { BGR.GCW_surrender_progress < SGR.GCW_surrender_progress }
		}
		add_to_variable = { BGR_points = 1 }
	}

	#Adding Führer selection boni

	if = {
		limit = {
			GER = { has_country_flag = bormann_for_germany }
		}
		add_to_variable = { BGR_points = 2 }
	}
	else_if = {
		limit = {
			GER = { has_country_flag = speer_for_germany }
		}
		add_to_variable = { SGR_points = 2 }
	}

	#Choosing the victor
	if = {
		limit = {
			check_variable = { SGR_points > BGR_points }
		}
		SGR = { add_ideas = GCW_hidden_holy_shit_win_already }
		BGR = { add_ideas = GCW_too_late_TOO_LATE }
		GGR = { add_ideas = GCW_too_late_TOO_LATE }
		HGR = { add_ideas = GCW_too_late_TOO_LATE }
	}
	else_if = {
		limit = {
			check_variable = { BGR_points > SGR_points }
		}
		BGR = { add_ideas = GCW_hidden_holy_shit_win_already }
		SGR = { add_ideas = GCW_too_late_TOO_LATE }
		GGR = { add_ideas = GCW_too_late_TOO_LATE }
		HGR = { add_ideas = GCW_too_late_TOO_LATE }
	}
	else = {
		GGR = { add_ideas = GCW_too_late_TOO_LATE }
		HGR = { add_ideas = GCW_too_late_TOO_LATE }
		random_list = {
			10 = {
				BGR = { add_ideas = GCW_hidden_holy_shit_win_already }
				SGR = { add_ideas = GCW_too_late_TOO_LATE }
			}
			10 = {
				SGR = { add_ideas = GCW_hidden_holy_shit_win_already }
				BGR = { add_ideas = GCW_too_late_TOO_LATE }
			}
		}
	}
	set_global_flag = GCW_no_more_balancing
}

GER_GCW_econ_setup = {
	TNO_startup_nation = yes # Needs to be run first

	## Econ Variable Initiation
	set_variable = { GDP_growth = -1.1 }
	set_variable = { base_inflation_rate = 0.68 }
	set_variable = { income_tax_rate = 0.42 }
	set_variable = { business_tax_rate = 0.56 }
	set_variable = { poverty_rate = 44.12 }
	set_variable = { poverty_monthly_change = -0.87 }



	initiate_display_vars = yes

	## Slider Positions
	army_funding_maximal_set_position_20 = yes
	army_funding_minimal_set_position_0 = yes

	naval_funding_maximal_set_position_20 = yes
	naval_funding_minimal_set_position_0 = yes

	social_funding_maximal_set_position_10 = yes
	social_funding_minimal_set_position_0 = yes

	admin_funding_maximal_set_position_10 = yes
	admin_funding_minimal_set_position_0 = yes

	research_funding_maximal_set_position_10 = yes
	research_funding_minimal_set_position_0 = yes

	consumer_goods_maximal_set_position_20 = yes
	consumer_goods_minimal_set_position_0 = yes

	## Credit Rating
	set_temp_variable = { temp_credit_rating_min = 2 }
	set_temp_variable = { temp_credit_rating_max = 5 }
	set_temp_variable = { temp_credit_rating = 3 }
	econ_initialize_credit_rating_system = yes

	## Manpower boost so they don't start with 0
	add_manpower = 30000
}


#Stuff to alleviate Germania's GDP being nuked back to burgundian level
calculate_GCW_Debt_save = {
	set_variable = { GCW_debt_save = -1 }
	subtract_from_variable = { GCW_debt_save = credit_rating_effect_on_debt_GDP_effect }
}

GER_GCW_begin = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_begin; Executing"

	country_event = { id = gcw_dbg.20 days = 200 }
	
	# ADDED BY ODF - Operation Deep Freeze
	# New Swabia Reaction Event
	AAG = { country_event = { id = antarctica_aag_survival.10 } }
	AAG = { country_event = { id = antarctica_aag_division.200 hours = 6 } }

	## Ownership & Cores Getting set up
	# Speer
	every_owned_state = {
		limit = { is_SGR_state = yes }
		#set_demilitarized_zone = no
		SGR = {
			add_state_core = PREV
			transfer_state = PREV
		}
	}
	SGR = {
		add_to_array = { global.GCW_contenders = THIS }
		GER_GCW_econ_setup = yes
		inherit_technology = PREV
		set_province_controller = 529
		load_oob = SGR
		load_oob = SGR_air
		setup_speer_gcw_navy = yes
		set_war_support = GER.GER_Speer_Influence
		set_variable = { GCW_legitimacy = GER.GER_Speer_Influence }
		if = {
			limit = { GER = { has_country_flag = speer_for_germany } }
			SGR = { set_variable = { GCW_legitimacy = 100 } }
		}
		GCW_intialise_legitimacy = yes
		if = {
			limit = {
				has_game_rule = {
					rule = GER_CIVIL_WAR_BUFF
					option = GER_CIVIL_WAR_BUFF_SPEER
				}
			}
			add_ideas = Custom_TNO_war_buff
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = 50000
				producer = GER
			}
		}

		#because he just doesnt get enough :(
		add_equipment_to_stockpile = {
			type = infantry_equipment
			amount = 5000
			producer = GER
		}

		#econtype
		set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Gelenkte_Wirtschaft }
		econ_subtype_change = yes

		if = {
			limit = {
				check_variable = { GER.GCW_Speer_infantry_weapons > 0 }
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = GER.GCW_Speer_infantry_weapons
				producer = GER
			}
		}
		if = {
			limit = {
				check_variable = { GER.GCW_Speer_heer_units > 0 }
			}
			hidden_effect = {
				capital_scope = {
					create_unit = {
						division = "division_template = \"Infanterie-Division\" start_experience_factor = 0.1 start_equipment_factor = 0.3"
						owner = PREV
						count = GER.GCW_Speer_heer_units
					}
				}
			}
		}
		if = {
			limit = { GER = { has_variable = GCW_Speer_prod_units } }
			set_temp_variable = { pus_temp = GER.GCW_Speer_prod_units }
			econ_pus_change = yes
			clear_variable = GER.GCW_Speer_prod_units
		}
		if = {
			limit = { GER = { has_country_flag = speer_for_germany } }
			change_tag_from = GER
			SGR = { add_ideas = GER_hitlers_chosen_successor }
			if = {
				limit = {
					SGR = { is_ai = yes }
				}
				SGR = { add_ideas = GCW_hidden_speer_buff }
			}
		}
	}

	# Göring
	every_owned_state = {
		limit = { is_GGR_state = yes }
		#set_demilitarized_zone = no
		GGR = {
			add_state_core = PREV
			transfer_state = PREV
		}
	}
	GGR = {
		add_to_array = { global.GCW_contenders = THIS }
		GER_GCW_econ_setup = yes
		inherit_technology = PREV
		promote_character = {
			character = GER_hermann_goring
			ideology = national_socialism_machiavellian_nazism_goring_subtype
		}

		load_oob = GGR
		if = {
			limit = {
				GER = { has_country_flag = goring_for_germany }
				GER = {
					is_ai = yes
				}
				GGR = {
					is_ai = yes
				}
			}
			load_oob = GGR
		}
		load_oob = GGR_air
		setup_goering_gcw_navy = yes
		set_war_support = GER.GER_Goring_Influence
		set_variable = { GCW_legitimacy = GER.GER_Goring_Influence }
		GCW_intialise_legitimacy = yes

		add_country_leader_role = {
			character = GER_ferdinand_schorner
			promote_leader = yes
			country_leader = {
				ideology = national_socialism_2_schorner_subtype
				expire = "2000.1.1.1"
				desc = "POLITICS_FERDINAND_SCHORNER_DESC"
			}
		}

		country_event = { id = goering_successor.14 days = 6  }
		country_event = { id = goering_successor.12 days = 10 }
		country_event = { id = goering_successor.11 days = 5  }
		country_event = { id = goering_successor.10 days = 12 }

		#econtype
		set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Gelenkte_Wirtschaft }
		econ_subtype_change = yes

		if = {
			limit = {
				check_variable = { GER.GCW_Goring_infantry_weapons > 0 }
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = GER.GCW_Goring_infantry_weapons
				producer = GER
			}
		}
		if = {
			limit = {
				check_variable = { GER.GCW_Goring_heer_units > 0 }
			}
			hidden_effect = {
				capital_scope = {
					create_unit = {
						division = "division_template = \"Infanterie-Division\" start_experience_factor = 0.1 start_equipment_factor = 0.3"
						owner = PREV
						count = GER.GCW_Goring_heer_units
					}
				}
			}
		}
		if = {
			limit = { GER = { has_variable = GCW_Goring_prod_units } }
			set_temp_variable = { pus_temp = GER.GCW_Goring_prod_units }
			econ_pus_change = yes
			clear_variable = GER.GCW_Goring_prod_units
		}
		if = {
			limit = { GER = { has_country_flag = goring_for_germany } }
			change_tag_from = GER
			GGR = { add_ideas = GER_hitlers_chosen_successor }
		}
	}

	# Bormann
	every_owned_state = {
		limit = { is_BGR_state = yes }
		#set_demilitarized_zone = no
		BGR = {
			add_state_core = PREV
			transfer_state = PREV
		}
	}
	BGR = {
		add_to_array = { global.GCW_contenders = THIS }
		GER_GCW_econ_setup = yes
		inherit_technology = PREV
		load_oob = BGR
		load_oob = BGR_air
		set_war_support = GER.GER_Bormann_Influence
		set_variable = { GCW_legitimacy = GER.GER_Bormann_Influence }
		GCW_intialise_legitimacy = yes

		#econtype
		set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Gelenkte_Wirtschaft }
		econ_subtype_change = yes

		if = {
			limit = {
				check_variable = { GER.GCW_Bormann_infantry_weapons > 0 }
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = GER.GCW_Bormann_infantry_weapons
				producer = GER
			}
		}
		if = {
			limit = {
				has_game_rule = {
					rule = GER_CIVIL_WAR_BUFF
					option = GER_CIVIL_WAR_BUFF_BORMANN
				}
			}
			add_ideas = Custom_TNO_war_buff
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = 50000
				producer = GER
			}
		}
		if = {
			limit = {
				check_variable = { GER.GCW_Bormann_heer_units > 0 }
			}
			hidden_effect = {
				capital_scope = {
					create_unit = {
						division = "division_template = \"Infanterie-Division\" start_experience_factor = 0.1 start_equipment_factor = 0.3"
						owner = PREV
						count = GER.GCW_Bormann_heer_units
					}
				}
			}
		}
		if = {
			limit = { GER = { has_variable = GCW_Bormann_prod_units } }
			set_temp_variable = { pus_temp = GER.GCW_Bormann_prod_units }
			econ_pus_change = yes
			clear_variable = GER.GCW_Bormann_prod_units
		}
		if = {
			limit = { GER = { has_country_flag = bormann_for_germany } }
			change_tag_from = GER
			BGR = { add_ideas = GER_hitlers_chosen_successor }
		}
	}

	# Heydrich
	every_owned_state = {
		limit = { is_HGR_state = yes }
		#set_demilitarized_zone = no
		HGR = {
			add_state_core = PREV
			transfer_state = PREV
		}
	}
	HGR = {
		if = {
			limit = { country_exists = HGR } #The above state transfer already checks if Heydrich is indisposed or not

			add_to_array = { global.GCW_contenders = THIS }
			GER_GCW_econ_setup = yes
			inherit_technology = PREV
			load_oob = HGR
			load_oob = HGR_air
			setup_heydrich_gcw_navy = yes
			set_war_support = GER.GER_Heydrich_Influence
			set_variable = { GCW_legitimacy = GER.GER_Heydrich_Influence }
			GCW_intialise_legitimacy = yes
			#if = {
			#	limit = {
			#		has_game_rule = { rule = GER_CIVIL_WAR_BUFF option = GER_CIVIL_WAR_BUFF_HEYDRICH }
			#	}
			#	add_ideas = Custom_TNO_war_buff
			#	load_oob = HGR
			#	load_oob = HGR
			#	add_equipment_to_stockpile = {
			#		type = infantry_equipment
			#		amount = 50000
			#		producer = GER
			#	}
			#}

			#econtype
			set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Burgsys }
			econ_subtype_change = yes

			if = {
				limit = {
					check_variable = { GER.GCW_Heydrich_infantry_weapons > 0 }
				}
				add_equipment_to_stockpile = {
					type = infantry_equipment
					amount = GER.GCW_Heydrich_infantry_weapons
					producer = GER
				}
			}
			if = {
				limit = {
					check_variable = { GER.GCW_Heydrich_heer_units > 0 }
				}
				hidden_effect = {
					capital_scope = {
						create_unit = {
							division = "division_template = \"Schutzstaffel-Infanterie\" start_experience_factor = 0.1 start_equipment_factor = 0.3"
							owner = PREV
							count = GER.GCW_Heydrich_heer_units
						}
					}
				}
			}
			if = {
				limit = { GER = { has_variable = GCW_Heydrich_prod_units } }
				set_temp_variable = { pus_temp = GER.GCW_Heydrich_prod_units }
				econ_pus_change = yes
				clear_variable = GER.GCW_Heydrich_prod_units
			}
			if = {
				limit = { GER = { has_country_flag = heydrich_for_germany } }
				change_tag_from = GER
				HGR = { add_ideas = GER_hitlers_chosen_successor }
			}
			if = {
				limit = { GER = { has_country_flag = HGR_burgundian_reinforcements } }
				28 = {
					create_unit = {
						division = "name = \"Burgundische Panzer-Division\" division_template = \"Burgundische Panzer-Division\" start_experience_factor = 0.3"
						owner = HGR
					}
				}
				28 = {
					create_unit = {
						division = "name = \"Burgundische Panzer-Division\" division_template = \"Burgundische Panzer-Division\" start_experience_factor = 0.3"
						owner = HGR
					}
				}
			}
		}
	}
	GGR = {
		set_province_controller = 421
		set_province_controller = 3414
		set_province_controller = 6485
		set_province_controller = 3583
	}

	## Spawn Bohemia
	remove_state_core = 9
	remove_state_core = 75
	CZE = {
		transfer_state = 9
		transfer_state = 75
		add_state_core = 9
		add_state_core = 75
		inherit_technology = PREV
		load_oob = "CZE_1962"
		TNO_startup_nation = yes
		country_event = { id = reich.800 days = 18 }
	}

	## War Declaration, ideas & focus tree loading

	## Divide equipment
	# 25% to boreman
	send_equipment_fraction = {
		target = BGR
		value = 0.25
	}
	# 25% to spet
	send_equipment_fraction = {
		target = SGR
		value = 0.34
	}
	# 20% to goring
	send_equipment_fraction = {
		target = GGR
		value = 0.4
	}
	# 10% to heydrich
	send_equipment_fraction = {
		target = HGR
		value = 0.33
	}
	# 10% goes bye bye keep 10%
	send_equipment_fraction = {
		target = ZZZ
		value = 0.5
	}

	#Ditch the pre-CW ideas
	remove_ideas = {
		to_banish_want
		the_two_principles
		endsieg
		gone_over
		man_on_the_moon
	}
	BGR = {
		declare_war_on = { target = GGR type = civil_war }
		add_ideas = GER_BGR_civil_war_offense
		load_focus_tree = tno_bormann_civil_war
	}

	GGR = {
		add_ideas = GER_GGR_civil_war_offense
	}

	SGR = {
		declare_war_on = { target = BGR type = civil_war }
		declare_war_on = { target = GGR type = civil_war }
		add_ideas = GER_SGR_civil_war_offense
		load_focus_tree = tno_speer_civil_war
	}

	HGR = {
		if = {
			limit = { country_exists = THIS }

			declare_war_on = { target = BGR type = civil_war }
			declare_war_on = { target = GGR type = civil_war }
			declare_war_on = { target = SGR type = civil_war }
			add_ideas = GER_HGR_civil_war_offense
			load_focus_tree = HGR_civil_war
		}
	}

	## Remove legitimacy decisions
	clr_country_flag = GER_power_struggle

	## Set up global flag
	set_global_flag = german_civil_war

	## No more super :(
	remove_superpower = yes

	## Downgrade credit rating
	econ_lower_credit_rating = yes
	econ_lower_credit_rating = yes
	econ_lower_credit_rating = yes

	## Just to ensure Speidel doesn't get into a fiscal crisis
	add_ideas = GCW_hidden_credit_buff
	add_ideas = GCW_state_value_buff

	BGR = { add_ideas = GCW_state_value_buff }
	SGR = { add_ideas = GCW_state_value_buff }
	GGR = { add_ideas = GCW_state_value_buff }
	HGR = { add_ideas = GCW_state_value_buff }
	GER = {
		calculate_GCW_Debt_save = yes
		add_dynamic_modifier = {
			modifier = GER_Debt_stalling
			scope = GER
		}
		set_temp_variable = { temp_credit_rating_min = 8 }
		set_temp_variable = { temp_credit_rating_max = 8 }
		econ_set_min_credit_rating = yes
		econ_set_max_credit_rating = yes
	}

	## News Event Time
	every_country = {
		limit = { is_ai = no }
		news_event = WORLD_REICH.8
	}

	#Winter olympics success
	CAN = {
		news_event = { id = WORLD.18218 days = 100 }
	}

	log = "[GetDateText]: [This.GetName]: GER_GCW_begin; Completed execution."
}

## GCW Conclusion Effects
GER_GCW_conclude = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude; Executing"
	custom_effect_tooltip = GER_fix_your_shit_pdx

	if = { 
		limit = { NOT = { has_global_flag = german_civil_war_heydrichvic } }
		GER = {
			country_event = {
				id = reich_shared.23
				days = 31
			}
		}
	}
	hidden_effect = {
		# Just in case
		BGR = { remove_ideas = Anti_Heydrich_Pact }
		SGR = { remove_ideas = Anti_Heydrich_Pact }
		GGR = { remove_ideas = Anti_Heydrich_Pact }
		remove_ideas = GCW_hidden_credit_buff
		remove_ideas = GCW_state_value_buff
	}

	hidden_effect = {
		##Conclude
		GER = {
			remove_dynamic_modifier = {
				modifier = GER_Debt_stalling
			}
			#Flag Stuff
			clr_global_flag = german_civil_war
			set_global_flag = german_civil_war_end
			clr_global_flag = GCW_Speidel_Refused_Victor
			clr_global_flag = GCW_Speidel_Active
			clr_country_flag = GER_bormann_breaks_away
			clr_country_flag = GER_goring_breaks_away
			clr_country_flag = GER_speer_breaks_away
			clr_country_flag = GER_goring_breaks_away
			clr_country_flag = speidel_in_charge
			clr_country_flag = GER_Speidel_Militarist_Leader

			#General
			PREV = { transfer_navy = { target = GER } }
			inherit_technology = PREV
			drop_cosmetic_tag = yes
			set_political_power = 200
			if = {
				limit = { 
					GER = { has_opinion_modifier = GER_sanctions_lifted } 
				}
				BRG = {
					remove_opinion_modifier = { target = GER modifier = GER_sanctions_lifted }
					add_opinion_modifier = { target = GER modifier = GER_soft_sanctions }
				}
			}
			if = {
				limit = { 
					BRG = { has_opinion_modifier = BRG_supplies_reopened }
				}
				GER = {
					remove_opinion_modifier = { target = BRG modifier = BRG_supplies_reopened }
				}
			}

			#Specific
			if = {
				limit = { PREV = { tag = BGR } }
				# clear GCW buffs
				BGR = {
					remove_ideas = {
						GCW_hidden_debuff_1
						GCW_hidden_debuff_2
						GCW_hidden_debuff_3
						GCW_hidden_holy_shit_win_already
					}
					every_character = { ## BGR Characters return to GER ##
						limit = { NOT = { is_character = BGR_Generic_Vacant } }
						set_nationality = GER
					}
				}

				log = "[GetDateText]: [Prev.GetName]: GER_GCW_conclude; Bormann Victory"
				set_global_flag = german_civil_war_bormannvic
				GER_GCW_conclude_bormann = yes

				country_event = { id = reich.559 days = 7 } # Heydrich dead event
				#country_event = { id = CA_Bormann.1 days = 1800 random_days = 30 }
				if = {
					limit = { 
						has_global_flag = FEN_GF_WonEcw
						NOT = {
							has_game_rule = {
								rule = BRITAIN_CONTENT_STATUS
								option = BRITAIN_OLD
							}
						} 
					}
					ENG = {
						country_event = {
							id = channelcrisis.1
							days = 5
						}
					}
				}
			}
			else_if = {
				limit = { PREV = { tag = GGR } }
				# clear GCW buffs
				GGR = {
					remove_ideas = {
						GCW_hidden_debuff_1
						GCW_hidden_debuff_2
						GCW_hidden_debuff_3
						GCW_hidden_holy_shit_win_already
					}
					every_character = { ## GGR Characters return to GER ##
						limit = { NOT = { is_character = GGR_Generic_Vacant } }
						set_nationality = GER
					}
				}

				log = "[GetDateText]: [Prev.GetName]: GER_GCW_conclude; Goering Victory"
				set_global_flag = german_civil_war_goeringvic
				GER_GCW_conclude_goering = yes

				country_event = { id = reich.559 days = 7 } # Heydrich dead event
				if = {
					limit = { 
						has_global_flag = FEN_GF_WonEcw
						NOT = {
							has_game_rule = {
								rule = BRITAIN_CONTENT_STATUS
								option = BRITAIN_OLD
							}
						}
					}
					ENG = {
						country_event = {
							id = channelcrisis.1
							days = 5
						}
					}
				}
			}
			else_if = {
				limit = { PREV = { tag = SGR } }
				# clear GCW buffs
				SGR = {
					remove_ideas = {
						GCW_hidden_debuff_1
						GCW_hidden_debuff_2
						GCW_hidden_debuff_3
						GCW_hidden_holy_shit_win_already
					}
					every_character = { ## SGR Characters return to GER ##
						limit = { NOT = { is_character = SGR_Generic_Vacant } }
						set_nationality = GER
					}
				}

				log = "[GetDateText]: [Prev.GetName]: GER_GCW_conclude; Speer Victory"
				set_global_flag = german_civil_war_speervic
				GER_GCW_conclude_speer = yes

				#country_event = { id = CA_Speer.1 days = 1800 random_days = 30 }
				country_event = { id = reich.559 days = 7 } # Heydrich dead event
				if = {
					limit = { 
						has_global_flag = FEN_GF_WonEcw
						NOT = {
							has_game_rule = {
								rule = BRITAIN_CONTENT_STATUS
								option = BRITAIN_OLD
							}
						} 
					}
					ENG = {
						country_event = {
							id = channelcrisis.1
							days = 5
						}
					}
				}
			}
			else_if = {
				limit = { PREV = { tag = HGR } }
				# clear GCW buffs
				HGR = {
					remove_ideas = {
						GCW_hidden_debuff_1
						GCW_hidden_debuff_2
						GCW_hidden_debuff_3
						GCW_hidden_holy_shit_win_already
					}
					every_character = { ## HGR Characters return to GER ##
						limit = { NOT = { is_character = HGR_Generic_Vacant } }
						set_nationality = GER
					}
				}

				every_unit_leader = {
					limit = { has_id = 70 }
					set_nationality = ZZZ
				}

				log = "[GetDateText]: [Prev.GetName]: GER_GCW_conclude; Heydrich Victory"
				set_global_flag = german_civil_war_heydrichvic
				GER_GCW_conclude_heydrich = yes

				if = {
					limit = { has_global_flag = FEN_GF_WonEcw }
					ENG = {
						country_event = {
							id = hmmlrSkeleton.1
							days = 30
						}
						meta_effect = { #sets up next election date in country ui
							text = {
								set_politics = {
									ruling_party = despotism
									last_election = "[current_election_date]"
									elections_allowed = yes
									election_frequency = 5
								}
							}
							current_election_date = "[?global.date.GetDateStringNoHour]"
						}
					}
				}
			}
			else = {
				log = "[GetDateText]: [Prev.GetName]: GER_GCW_conclude; Unexpected Victory"
			}

			#Recreate the Pakt
			create_faction = Einheitspakt
			GER = {
				add_ideas = Pakt_Leader
				if = {
					limit = {
						NOT = { has_global_flag = goering_betrayed_allies }
					}
					add_to_faction = HUN
					add_to_faction = ROM
					add_to_faction = TNS
					add_to_faction = BUL
					add_to_faction = FRS
					BUL = { econ_join_sphere_GER = yes }
					HUN = { econ_join_sphere_GER = yes }
					ROM = { econ_join_sphere_GER = yes }
					TNS = { econ_join_sphere_GER = yes }
					PER = { add_ideas = Pakt_Observer }
					PER = { econ_join_sphere_GER = yes }
					FRS = { 
						econ_join_sphere_GER = yes 
						add_ideas = Pakt_Mitstreiter
					}
				}
				AAF = { econ_join_sphere_GER = yes }
				if = {
					limit = {
						has_global_flag = ENG_GF_WonEcw
						NOT = {
							has_game_rule = {
								rule = BRITAIN_CONTENT_STATUS
								option = BRITAIN_OLD
							}
						}
					}
					add_to_faction = ENG
					ENG = { 
						econ_join_sphere_GER = yes
						add_ideas = Pakt_Mitstreiter
					}
				}
				if = {
					limit = { has_global_flag = german_civil_war_speervic }
					BUL = { join_zollverein = yes }
					HUN = { join_zollverein = yes }
					ROM = { join_zollverein = yes }
					TNS = { join_zollverein = yes }
					FRS = { join_zollverein = yes }
					PER = { join_zollverein = yes }
					if = {
						limit = {
							has_global_flag = ENG_GF_WonEcw
							NOT = {
								has_game_rule = {
									rule = BRITAIN_CONTENT_STATUS
									option = BRITAIN_OLD
								}
							}
						}
						ENG = { join_zollverein = yes }
					}
				}
			}

			#GDP Stuff (to clarify w/ later GCW work)
			set_variable = { GDP_growth = 0.001 }

			#Closing
			annex_country = { target = PREV transfer_troops = yes }

			#Remove GCW Cores
			every_owned_state = {
				remove_core_of = GGR
				remove_core_of = BGR
				remove_core_of = SGR
				remove_core_of = HGR
			}

			#Extremely lazy solution to Speidel being an economic genius
			multiply_variable = { money_reserves = 0.0 } #already converted to billion

			delete_unit_template_and_units = { division_template = "Bürgerwehr" }
			delete_unit_template_and_units = { division_template = "Bürgerwehr 2" }
			delete_unit_template_and_units = { division_template = "Bürgerwehr 3" }

			#Himmler shenanigans
			BRG = {
				TNO_BRG_domestic_tree_swap = yes
				set_temp_variable = { target = GGR }
				TNO_clear_num_volunteers = yes
				set_temp_variable = { target = HGR }
				TNO_clear_num_volunteers = yes
				clr_country_flag = BRG_fall_ragnarchar_allowed
			}

			#Rommel retires again
			retire_character = GER_erwin_rommel

			#Add XP
			army_experience = 100
			air_experience = 100
			navy_experience = 20

			if = {
				limit = {
					has_global_flag = SER_collabs_won_civil_war
					NOT = { has_global_flag = goering_betrayed_allies }
				}
				GER = { add_to_faction = SER }
				if = {
					limit = { has_global_flag = german_civil_war_speervic }
					SER = { join_zollverein = yes }
				}
				SER = {
					econ_join_sphere_GER = yes
					add_ideas = Pakt_Mitstreiter
				}
			}	

			GER = { 
				if = {
					limit = {
						NOT = {
							has_global_flag = german_civil_war_goeringvic
						}
					}
					country_event = { id = serbia.100 days = 180 }
				}
			}
			
			add_ideas = {
				Pakt_Leader
			}

			#Super again :)
			set_superpower = yes

			#Fix SAW score
			if = {
				limit = {
					has_country_flag = SAW_early_end
				}
				if = {
					limit = { has_global_flag = SAF_OFN_Victory }
					set_temp_variable = { Victory_ID = 4 }
					set_temp_variable = { Victory_Outcome = 1 }
					set_temp_variable = { Victory_Points = -300 }
					Cold_War_GUI_ManipulateVictory = yes
				}
				else_if = {
					limit = { has_global_flag = SAF_OFN_Ceasefire }
					set_temp_variable = { Victory_ID = 4 }
					set_temp_variable = { Victory_Outcome = 2 }
					set_temp_variable = { Victory_Points = -150 }
					Cold_War_GUI_ManipulateVictory = yes
				}
				else_if = {
					limit = { has_global_flag = SAF_Stalemate }
					set_temp_variable = { Victory_ID = 4 }
					set_temp_variable = { Victory_Outcome = 3 }
					Cold_War_GUI_ManipulateVictory = yes
				}
				else_if = {
					limit = { has_global_flag = SAF_Schild_Ceasefire }
					set_temp_variable = { Victory_ID = 4 }
					set_temp_variable = { Victory_Outcome = 4 }
					set_temp_variable = { Victory_Points = 150 }
					Cold_War_GUI_ManipulateVictory = yes
				}
				else_if = {
					limit = { has_global_flag = SAF_Schild_Victory }
					set_temp_variable = { Victory_ID = 4 }
					set_temp_variable = { Victory_Outcome = 5 }
					set_temp_variable = { Victory_Points = 300 }
					Cold_War_GUI_ManipulateVictory = yes
				}
			}

			#Puppet Bohemia
			CZE = {
				if = {
					limit = {
						exists = yes
						has_country_flag = GER_CZE_joined_gcw
					}
					save_party_popularities = yes
					GER = {
						set_autonomy = {
							target = CZE
							autonomy_state = autonomy_reichsprotektorat
						}
					}
					apply_party_popularities = yes
					econ_join_sphere_GER = yes
				}
			}

			# German Madagascar Returns
			
			if = {
				limit = {
					MAD = { has_cosmetic_tag = MDG_GERMAN }
					has_global_flag = MAD_civil_war_over
				}
				if = {
					limit = { 
						check_variable = {
							var = global.Madagascar_GER_influence
							value = global.Madagascar_FRA_influence
							compare = greater_than_or_equals
						}
					}
					# event, legal annex 
					country_event = {
						id = MAD.600
						days = 14
					}
				}
				else = {
					# illegal annex
					country_event = {
						id = MAD.601
						days = 14
					}
				}
				set_temp_variable = { Victory_ID = 26 }
				set_temp_variable = { Victory_Outcome = 5 }
				set_temp_variable = { Victory_Points = 100 }
				Cold_War_GUI_AddVictory = yes
			}
			else_if = {
				limit = {
					has_global_flag = MAD_civil_war_over
				}
				set_temp_variable = { Victory_ID = 26 }
				set_temp_variable = { Victory_Outcome = 1 }
				set_temp_variable = { Victory_Points = -100 }
				Cold_War_GUI_AddVictory = yes			
			}

			# Britain - if in 60 days the 2GU is still going on, this will add a hiddden buff to the collabs
			ENG = {
				country_event = { id = collab_cw.0 days = 60 } 
			}
		
			# North Atlantic control (because of France)
			set_temp_variable = { SeaZone_ID = 3 } # 3; North Atlantic
			Cold_War_GUI_PowerProjection_AddSeaZone = yes
			
			# North Sea control
			set_temp_variable = { SeaZone_ID = 4 } # 4; North Sea
			Cold_War_GUI_PowerProjection_AddSeaZone = yes
			
			# Med control (France and glorious Bulgaria)
			set_temp_variable = { SeaZone_ID = 5 } # 5: Med
			Cold_War_GUI_PowerProjection_AddSeaZone = yes

			# Ongoing SAW
			if = {
				limit = { has_global_flag = south_african_war_happening }
				set_temp_variable = { SeaZone_ID = 2 } # 2; South Atlantic
				Cold_War_GUI_PowerProjection_AddSeaZone = yes
				set_temp_variable = { SeaZone_ID = 6 } # 6; Indian Ocean
				Cold_War_GUI_PowerProjection_AddSeaZone = yes
			}

			#Transfer player tag (has to be done last, anything coded after this won't work properly)
			if = { limit = { PREV = { is_ai = no } } change_tag_from = PREV }
		}

		ZZZ = {
			econ_recompile_all_spheres = yes
			generate_econ_rankings = yes
			econ_get_world_gdp = yes
		}
	}


	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude; Completed execution."
}

GER_GCW_conclude_bormann = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_bormann; Executing."
	## Ideas
	remove_all_ministers = yes
	remove_ideas = GER_Hans_Speidel_army_chief
	add_ideas = {
		#Spirits


		#Ministers
		GER_Baldur_von_Schirach_hog
		GER_Wilhelm_Burgdorf_sec
		GER_Walther_Hewel_for
		GER_Kurt_Lange_eco
		GER_Fedor_von_Bock_high_command
		GER_Wilhelm_Burgdorf_high_command
		GER_Walther_Wenck_army_chief
	}

	## Politics
	GER = {
		GER_martin_bormann = {
			promote_character = national_socialism_subtype
		}
		GER_hans_filbinger = {
			promote_character = paternalism_subtype
		}
		GER_eugen_gerstenmaier = {
			promote_character = conservatism_subtype
		}
	}

	# Political Popularity & Ruling Party
	set_politics = { ruling_party = national_socialism }
	set_popularities = {
		communist = 0
		socialist = 0
		progressivism = 0
		liberalism = 0

		conservatism = 2
		paternalism = 4
		despotism = 0
		fascism = 18
		national_socialism = 60
		ultranationalism = 16

	}

	# Party Names
	set_party_name = {
		ideology = national_socialism
		long_name = BGR_national_socialism_party_long
		name = BGR_national_socialism_party
	}
	set_party_name = {
		ideology = fascism
		long_name = BGR_fascism_party_long
		name = BGR_fascism_party
	}
	set_party_name = {
		ideology = paternalism
		long_name = BGR_paternalism_party_long
		name = BGR_paternalism_party
	}
	set_party_name = {
		ideology = conservatism
		long_name = BGR_conservatism_party_long
		name = BGR_conservatism_party
	}
	set_party_name = {
		ideology = liberalism
		long_name = BGR_liberalism_party_long
		name = BGR_liberalism_party
	}
	set_party_name = {
		ideology = progressivism
		long_name = BGR_progressivism_party_long
		name = BGR_progressivism_party
	}
	set_party_name = {
		ideology = socialist
		long_name = BGR_socialist_party_long
		name = BGR_socialist_party
	}
	set_party_name = {
		ideology = communist
		long_name = BGR_communist_party_long
		name = BGR_communist_party
	}
	set_party_name = {
		ideology = ultranationalism
		long_name = BGR_ultranationalism_party_long
		name = BGR_ultranationalism_party
	}

	## Content Setup
	set_country_flag = BOR_Phase1
	load_focus_tree = {
		tree = GER_bormann_post_cw_tree
		keep_completed = no
	}

	GER = {
		##Variable Initiation
		set_variable = { GDP = 234.634 } #in billions
		set_variable = { GDP_growth = 2.5 }
		set_variable = { base_inflation_rate = 2.4 }
		set_variable = { poverty_rate = 44.12 }
		set_variable = { poverty_monthly_change = -0.08 }
		set_variable = { money_reserves = 0.0 } #in billions
		set_variable = { national_debt = 229.08 } #in billions
		set_variable = { interest_rates = 3.0 }
		set_variable = { misc_income = 12.8 }
		set_variable = { misc_costs = 0.0 }

		initiate_display_vars = yes
	}

	if = { #Collaboids Faction Mechanic
		limit = {
			ENG = {
				has_country_flag = ENG_ready_for_faction_mech
			}
		}
		ENG = {
			country_event = {
				id = ENG_International_Mechanic.1
				days = 40
			}
		}
	}

	## Event
	country_event = { id = bormann.1 days = 3 }

	## Kaukasus oil
	if = {
		limit = { CAU = { has_country_flag = CAU_policy_business_bormann } }
		CAU = {
			give_resource_rights = { receiver = GER state = 229 resources = { oil aluminium rubber tungsten steel chromium uranium } }
			give_resource_rights = { receiver = GER state = 1552 resources = { oil aluminium rubber tungsten steel chromium uranium } }
			give_resource_rights = { receiver = GER state = 1554 resources = { oil aluminium rubber tungsten steel chromium uranium } }
		}
	}
	
	## Load navy
	setup_bormann_gcw_navy = yes

	## Starter natspirits
	add_ideas = {
		GER_BOR_political_rodeo_idea
		GER_BOR_shellshocked_wehrmacht_idea
		GER_BOR_the_reich_in_thousand_pieces_1_idea
		GER_BOR_lost_generation_1_idea
	}

	## Ireland Rejoining the Pakt
	IRE = { country_event = { id = IRE_eco_collapse.15 days = 100 } }
	
	# ADDED BY ODF - Operation Deep Freeze
	# New Swabia Reaction Event
	AAG = {
		country_event = { id = antarctica_aag_rescue.1 days = 60 }
		if = {
			limit = {
				has_country_flag = Antarctica_AAG_Division_Chose_Bormann
			}
			country_event = {
				id = antarctica_aag_gcw_division.50
				days = 1
			}
		}
		else = {
			country_event = {
				id = antarctica_aag_gcw_division.60
				days = 1
			}
		}
	}

	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_bormann; Completed execution."
}

GER_GCW_conclude_goering = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_goering; Executing."
	GER = {

		##Variable Initiation
		set_variable = { GDP = 234.634 } #in billions
		set_variable = { GDP_growth = 2.5 }
		set_variable = { base_inflation_rate = 2.4 }
		set_variable = { poverty_rate = 44.12 }
		set_variable = { poverty_monthly_change = -0.08 }
		set_variable = { money_reserves = 0.0 } #in billions
		set_variable = { national_debt = 229.08 } #in billions
		set_variable = { interest_rates = 3.0 }
		set_variable = { misc_income = 12.8 }
		set_variable = { misc_costs = 0.0 }

		initiate_display_vars = yes

		### Political
		set_variable = { tno_political_parties_effectiveness = 85 }
		set_variable = { tno_religious_rights_effectiveness = 79 }
		set_variable = { tno_trade_unions_effectiveness = 92 }
		set_variable = { tno_immigration_effectiveness = 40 }
		set_variable = { tno_slavery_effectiveness = 90 }
		set_variable = { tno_public_meetings_effectiveness = 84 }
		set_variable = { tno_press_rights_effectiveness = 81 }
		set_variable = { tno_vote_franchise_effectiveness = 51 }

		### Economic
		set_variable = { tno_trade_laws_effectiveness = 36 }
		set_variable = { tno_income_taxation_effectiveness = 91 }
		set_variable = { tno_minimum_wage_effectiveness = 47 }
		set_variable = { tno_max_workhours_effectiveness = 62 }
		set_variable = { tno_pensions_effectiveness = 48 }
		set_variable = { tno_unemployment_effectiveness = 52 }

		### Social
		set_variable = { tno_health_care_effectiveness = 47 }
		set_variable = { tno_education_effectiveness = 52 }
		set_variable = { tno_penal_system_effectiveness = 85 }
		set_variable = { tno_gender_rights_effectiveness = 72 }
		set_variable = { tno_security_effectiveness = 81 }
		set_variable = { tno_regulations_effectiveness = 60 }

		### Military
		set_variable = { tno_conscription_effectiveness = 85 }
		set_variable = { tno_military_supervision_effectiveness = 43 }
		set_variable = { tno_training_effectiveness = 52 }
		set_variable = { tno_draft_exemptions_effectiveness = 90 }
		remove_war_buff = yes
	}
	GGR_launch_goering_expanded_post_cw = yes
	remove_war_buff = yes

	
	# ADDED BY ODF - Operation Deep Freeze
	# New Swabia Reaction Event
	AAG = {
		country_event = { id = antarctica_aag_rescue.3 days = 60 }
		if = {
			limit = {
				has_country_flag = Antarctica_AAG_Division_Chose_Goring
			}
			country_event = {
				id = antarctica_aag_gcw_division.50
				days = 1
			}
		}
		else = {
			country_event = {
				id = antarctica_aag_gcw_division.60
				days = 1
			}
		}
	}

	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_goering; Completed execution."
}

GER_GCW_conclude_speer = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_speer; Executing."
	# Schorner and Remer survive/Steinhof is pardoned #
	GGR = {
		GER_ferdinand_schorner = {
			set_nationality = GER
		}
		GER_otto_ernst_remer = {
			set_nationality = GER
		}
		GER_johannes_steinhoff = {
			set_nationality = GER
		}
	}

	## Ideas
	remove_all_ministers = yes
	remove_ideas = GER_Robert_Ritter_von_Greim_air_chief
	add_ideas = {
		#Spirits
		GER_SGR_the_lost_generation
		GER_SGR_wary_wehrmacht
		GER_SGR_gang_of_four

		#Ministers
		GER_Kurt_Georg_Kiesinger_hog
		GER_Helmut_Schmidt_for
		GER_Ludwig_Erhard_eco
		GER_Henning_von_Tresckow_sec
		GER_Henning_von_Tresckow_high_command
		GER_Gunther_Luther_navy_chief
		GER_Johannes_Steinhoff_air_chief

	}
	swap_ideas = {
		remove_idea = tno_religious_rights_state_religion
		add_idea = tno_religious_rights_secularism
	}

	#Political Leaders
	GER = {
		#Albert Speer - Fash
		GER_albert_speer = {
			promote_character = { ideology = national_socialism_reformed_national_socialism_subtype }
		}
		#UNBEKANNT - AuthSoc + Libsoc
		GER_unbekannt = {
			promote_character = { ideology = communist_subtype }
			promote_character = { ideology = socialist_subtype }
		}
		#UNBEKANNT - SocDem
		promote_character = GER_willy_brandt
		#Various Leaders - SocLib
		promote_character = GER_various_leaders
		#Helmut Schmidt - AuthDem
		promote_character = GER_helmut_schmidt
		#Theodor Oberländer - NatSoc
		GER_theodor_oberlander = {
			promote_character = { ideology = national_socialism_2_subtype }
		}
	}

	# Political Popularity & Ruling Party
	set_politics = { ruling_party = national_socialism }
	set_popularities = {
		communist = 0
		socialist = 1
		progressivism = 1
		liberalism = 1

		conservatism = 0
		paternalism = 12
		despotism = 0
		national_socialism = 45
		national_socialism_2 = 40
		ultranationalism = 0
	}

	set_variable = { national_socialism_2_var = token:GER_SGR_national_socialism_2 }

	# Party Names
	set_party_name = {
		ideology = national_socialism_2
		long_name = SGR_national_socialism_2_party_long
		name = SGR_national_socialism_2_party
	}
	set_party_name = {
		ideology = national_socialism
		long_name = SGR_national_socialism_party_long
		name = SGR_national_socialism_party
	}
	set_party_name = {
		ideology = paternalism
		long_name = SGR_paternalism_party_long
		name = SGR_paternalism_party
	}
	set_party_name = {
		ideology = progressivism
		long_name = SGR_progressivism_party_long
		name = SGR_progressivism_party
	}
	set_party_name = {
		ideology = liberalism
		long_name = SGR_liberalism_party_long
		name = SGR_liberalism_party
	}
	set_party_name = {
		ideology = socialist
		long_name = SGR_socialist_party_long
		name = SGR_socialist_party
	}
	set_party_name = {
		ideology = communist
		long_name = SGR_communist_party_long
		name = SGR_communist_party
	}
	##Content Setup
	load_focus_tree = {
		tree = GER_speer_post_cw_tree
		keep_completed = no
	}

	#Speer Mechanics Init
	initialize_state_of_the_reich = yes
	initialize_speer_arrays = yes
	add_to_array = { ZV_members = THIS }

	## Policy Effectiveness

	GER = {
		### Political
		set_variable = { tno_political_parties_effectiveness = 73 }
		set_variable = { tno_religious_rights_effectiveness = 79 }
		set_variable = { tno_trade_unions_effectiveness = 92 }
		set_variable = { tno_immigration_effectiveness = 40 }
		set_variable = { tno_slavery_effectiveness = 82 }
		set_variable = { tno_public_meetings_effectiveness = 84 }
		set_variable = { tno_press_rights_effectiveness = 81 }
		set_variable = { tno_vote_franchise_effectiveness = 51 }

		### Economic
		set_variable = { tno_trade_laws_effectiveness = 36 }
		set_variable = { tno_income_taxation_effectiveness = 91 }
		set_variable = { tno_minimum_wage_effectiveness = 47 }
		set_variable = { tno_max_workhours_effectiveness = 62 }
		set_variable = { tno_pensions_effectiveness = 48 }
		set_variable = { tno_unemployment_effectiveness = 52 }

		### Social
		set_variable = { tno_health_care_effectiveness = 47 }
		set_variable = { tno_education_effectiveness = 52 }
		set_variable = { tno_penal_system_effectiveness = 85 }
		set_variable = { tno_gender_rights_effectiveness = 72 }
		set_variable = { tno_security_effectiveness = 81 }
		set_variable = { tno_regulations_effectiveness = 60 }

		### Military
		set_variable = { tno_conscription_effectiveness = 85 }
		set_variable = { tno_military_supervision_effectiveness = 43 }
		set_variable = { tno_training_effectiveness = 52 }
		set_variable = { tno_draft_exemptions_effectiveness = 57 }

		set_variable = { income_tax_rate = 0.45 }
		set_variable = { business_tax_rate = 0.83 }
		set_variable = { economic_centralization = 80 }
		hidden_effect = {
			set_temp_variable = { inflation_temp = 1.5 }
			econ_inflation_change = yes
			add_to_variable = { poverty_rate = 4 }
		}
	}

	## Event
	country_event = { id = speer.1 days = 3 }
	country_event = speer.10000

	if = { #Collaboids Faction Mechanic
		limit = {
			ENG = {
				has_country_flag = ENG_ready_for_faction_mech
			}
		}
		ENG = {
			country_event = {
				id = ENG_International_Mechanic.1
				days = 40
			}
		}
	}
	
	## Balance things
	set_stability = 0.5

	## For the AI to be able to use the RND gui
	if = {
		limit = { SGR = { is_ai = yes } }
		set_country_flag = RND_Tech_Window_Open
	}
	GER = {
		set_country_flag = country_has_gui
		set_country_flag = gui_alert_visible
		set_country_flag = gui_alert_visible_2
	}

	set_temp_variable = { temp_credit_rating = 7 }
	set_temp_variable = { temp_credit_rating_min = 7 }
	set_temp_variable = { temp_credit_rating_max = 9 }

	econ_initialize_credit_rating_system = yes

	## Ireland Rejoining the Pakt
	IRE = { country_event = { id = IRE_eco_collapse.15 days = 100 } }
	
	# ADDED BY ODF - Operation Deep Freeze
	# New Swabia Reaction Event
	AAG = {
		country_event = { id = antarctica_aag_rescue.2 days = 60 }
		if = {
			limit = {
				has_country_flag = Antarctica_AAG_Division_Chose_Speer
			}
			country_event = {
				id = antarctica_aag_gcw_division.50
				days = 1
			}
		}
		else = {
			country_event = {
				id = antarctica_aag_gcw_division.60
				days = 1
			}
		}
	}

	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_speer; Completed execution."
}

GER_GCW_conclude_heydrich = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_heydrich; Executing."
	clr_country_flag = country_has_gui
	## Ideas
	remove_all_ministers = yes
	add_ideas = {
		#Spirits


		#Ministers
		GER_Philipp_Bouhler_hog
		GER_Herbert_Otto_Gille_sec
		GER_Gunter_dAlquen_for
		GER_August_Frank_eco
	}

	## Politics
	GER = {
		GER_reinhard_heydrich = {
			promote_character = national_socialism_spartanism_subtype
		}
	}

	#econtype
	set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Burgsys }
	econ_subtype_change = yes

	# Political Popularity & Ruling Party
	set_politics = { ruling_party = national_socialism }
	set_popularities = {
		communist = 0
		socialist = 0
		progressivism = 0
		liberalism = 0

		conservatism = 0
		paternalism = 0
		despotism = 0
		fascism = 0
		national_socialism = 100
		ultranationalism = 0
	}

	# Party Names

	## Content Setup

	## Unit Leaders
	#Remove Speidelist Unit Leaders
	retire_character = GER_hans_speidel
	retire_character = GER_adolf_heusinger
	retire_character = GER_fritz_bayerlein
	retire_character = GER_ulrich_de_maiziere
	retire_character = GER_wolf_graf_von_baudissin
	retire_character = GER_axel_von_dem_bussche
	retire_character = GER_otto_hitzfeld
	retire_character = GER_bern_von_baer
	retire_character = GER_alfred_zerbel
	retire_character = GER_erich_topp
	retire_character = GER_horst_von_schroeter
	retire_character = GER_hansrudolf_rösing
	retire_character = GER_robert_gysae

	GER = { # annex bohemia into germany
		if = {
			limit = {
				has_country_flag = GER_CZE_secured_heydrich
			}
		}
		annex_country = {
			target = CZE
			transfer_troops = yes
		}
	}

	## Event
	country_event = { id = HGR.99 days = 1 }

	log = "[GetDateText]: [This.GetName]: GER_GCW_conclude_heydrich; Completed execution."
}

## GCW Contenders Managing Effects (Used in TNO_peace_on_actions.txt)
GER_GCW_check_victor = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_check_victor; Executing."

	if = {
		limit = { check_variable = { global.GCW_contenders^num = 1 } }
		#Cleanup space

		#Conclude
		if = {
			limit = { NOT = { has_global_flag = GCW_Speidel_Active } }
			GER = { country_event = { id = reich.30 } }
		}
		else = {
			#Fix up later, *will* cause issues
			clear_array = global.GCW_contenders
			GER_GCW_conclude = yes
		}
		log = "[GetDateText]: [This.GetName]: GER_GCW_check_victor;"
	}

	log = "[GetDateText]: [This.GetName]: GER_GCW_check_victor; Completed execution."
}

GER_GCW_off_a_fucker = {
	log = "[GetDateText]: [This.GetName]: GER_GCW_off_a_fucker; Executing."

	# funny workaround
	if = {
		limit = { has_global_flag = anti_heydrich_pact_formed }
		# speer dies
		if = {
			limit = {
				ROOT = { tag = SGR }
			}
			SGR = { dismantle_faction = yes }
			if = {
				limit = { country_exists = BGR }
				# bormann and goering left
				if = {
					limit = { country_exists = GGR }
					BGR = { create_faction = anti_heydrich_pact_faction }
					BGR = { add_to_faction = GGR }
				}
				# bormann left
				else = {
					clr_global_flag = anti_heydrich_pact_formed
				}
			}
			# goering left
			else = {
				clr_global_flag = anti_heydrich_pact_formed
			}
		}
		# bormann dies goering left or goering dies bormann left
		else_if = {
			limit = {
				OR = {
					ROOT = { tag = BGR }
					ROOT = { tag = GGR }
				}
				NOT = { country_exists = SGR }
			}
			BGR = { dismantle_faction = yes }
			clr_global_flag = anti_heydrich_pact_formed
		}
	}

	# anti-heydrich pact clean up
	if = {
		limit = {
			ROOT = { tag = HGR }
			has_global_flag = anti_heydrich_pact_formed
		}
		clr_global_flag = anti_heydrich_pact_formed
		if = {
			limit = { country_exists = SGR }
			SGR = { dismantle_faction = yes }
			if = {
				limit = { country_exists = BGR }
				BGR = {
					declare_war_on = { target = SGR type = civil_war }
				}
			}
			if = {
				limit = { country_exists = GGR }
				if = {
					limit = { country_exists = BGR }
					GGR = {
						declare_war_on = { target = BGR type = civil_war }
					}
				}
				GGR = {
					declare_war_on = { target = SGR type = civil_war }
				}
			}
		}
		else_if = {
			limit = { country_exists = BGR }
			BGR = { dismantle_faction = yes }
			if = {
				limit = { country_exists = BGR }
				GGR = {
					declare_war_on = { target = BGR type = civil_war }
				}
			}
		}
	}

	remove_from_array = { global.GCW_contenders = THIS }

	# clear GCW buffs
	remove_dynamic_modifier = { modifier = GCW_legitimacy_dynamic_modifier }
	remove_ideas = {
		GCW_hidden_debuff_1
		GCW_hidden_debuff_2
		GCW_hidden_debuff_3
	}

	log = "[GetDateText]: [This.GetName]: GER_GCW_off_a_fucker; Completed execution."
}

### Other Stuff ###
GER_hitler_advance = {
	GER = {
		if = {
			limit = { has_country_flag = GER_Hitler_Stage1 }
			clr_country_flag = GER_Hitler_Stage1
			set_country_flag = GER_Hitler_Stage2
		}
		else_if = {
			limit = { has_country_flag = GER_Hitler_Stage2 }
			clr_country_flag = GER_Hitler_Stage2
			set_country_flag = GER_Hitler_Stage3
		}
		else_if = {
			limit = { has_country_flag = GER_Hitler_Stage3 }
			clr_country_flag = GER_Hitler_Stage3
			set_country_flag = GER_Hitler_Stage4
		}
		else_if = {
			limit = { has_country_flag = GER_Hitler_Stage4 }
			clr_country_flag = GER_Hitler_Stage4
			set_country_flag = GER_Hitler_Stage5
		}
		else_if = {
			limit = { has_country_flag = GER_Hitler_Stage5 }
			clr_country_flag = GER_Hitler_Stage5
			set_country_flag = GER_Hitler_Stage6
		}
		else_if = {
			limit = { has_country_flag = GER_Hitler_Stage6 }
			clr_country_flag = GER_Hitler_Stage6
			set_country_flag = GER_Hitler_Stage7
			if = {
				limit = { is_ai = yes }
				set_variable = { GER_bohemia_cost = 150 }
			}
		}
		else_if = {
			limit = { has_country_flag = GER_Hitler_Stage7 }
			clr_country_flag = GER_Hitler_Stage7
			set_country_flag = GER_Hitler_Stage8
		}
	}
}

GCW_build_up_prod_units = {
	custom_effect_tooltip = GCW_build_up_prod_units_tt
	if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = bormann_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_bormann_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Bormann_prod_units = 1 }
		if = {
			limit = {
				has_country_flag = ai_bormann_build_up
				check_variable = { GER_Bormann_Influence > GER_Bormann_Influence_limit }
			}
			activate_mission = GER_GCW_bormann_build_up
		}
		else = {
			clr_country_flag = ai_bormann_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = goring_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_goring_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Goring_prod_units = 1 }
		if = {
			limit = {
				has_country_flag = ai_goring_build_up
				check_variable = { GER_Goring_Influence > GER_Goring_Influence_limit }
			}
			activate_mission = GER_GCW_goring_build_up
		}
		else = {
			clr_country_flag = ai_goring_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = speer_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_speer_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Speer_prod_units = 1 }
		if = {
			limit = {
				has_country_flag = ai_speer_build_up
				check_variable = { GER_Speer_Influence > GER_Speer_Influence_limit }
			}
			activate_mission = GER_GCW_speer_build_up
		}
		else = {
			clr_country_flag = ai_speer_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = heydrich_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_heydrich_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Heydrich_prod_units = 1 }
		if = {
			limit = {
				has_country_flag = ai_heydrich_build_up
				check_variable = { GER_Heydrich_Influence > GER_Heydrich_Influence_limit }
			}
			activate_mission = GER_GCW_heydrich_build_up
		}
		else = {
			clr_country_flag = ai_heydrich_build_up
		}
	}
}

GCW_build_up_forts = {
	custom_effect_tooltip = GCW_build_up_forts_tt
	if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = bormann_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_bormann_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		60 = {
			add_building_construction = {
				type = bunker
				level = 1
				province = 3561
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 2
				province = 3500
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 15825
				instant_build = yes
			}
		}
		65 = {
			add_building_construction = {
				type = bunker
				level = 1
				province = 514
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 6559
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 573
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 3514
				instant_build = yes
			}
		}
		set_country_flag = GCW_bormann_forts_done
		if = {
			limit = {
				has_country_flag = ai_bormann_build_up
				check_variable = { GER_Bormann_Influence > GER_Bormann_Influence_limit }
			}
			activate_mission = GER_GCW_bormann_build_up
		}
		else = {
			clr_country_flag = ai_bormann_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = goring_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_goring_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		58 = {
			add_building_construction = {
				type = bunker
				level = 2
				province = 3231
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 3368
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 9320
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 6257
				instant_build = yes
			}
		}
		set_country_flag = GCW_goring_forts_done
		if = {
			limit = {
				has_country_flag = ai_goring_build_up
				check_variable = { GER_Goring_Influence > GER_Goring_Influence_limit }
			}
			activate_mission = GER_GCW_goring_build_up
		}
		else = {
			clr_country_flag = ai_goring_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = speer_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_speer_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		55 = {
			add_building_construction = {
				type = bunker
				level = 2
				province = 3574
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 589
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 2
				province = 6488
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 6444
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 2
				province = 11560
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 3397
				instant_build = yes
			}
		}
		1813 = {
			add_building_construction = {
				type = bunker
				level = 1
				province = 11468
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 6487
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 2
				province = 9560
				instant_build = yes
			}
		}
		51 = {
			add_building_construction = {
				type = bunker
				level = 2
				province = 3547
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 3488
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 6570
				instant_build = yes
			}
		}
		set_country_flag = GCW_speer_forts_done
		if = {
			limit = {
				has_country_flag = ai_speer_build_up
				check_variable = { GER_Speer_Influence > GER_Speer_Influence_limit }
			}
			activate_mission = GER_GCW_speer_build_up
		}
		else = {
			clr_country_flag = ai_speer_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = heydrich_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_heydrich_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		42 = {
			add_building_construction = {
				type = bunker
				level = 2
				province = 1494
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 15852
				instant_build = yes
			}
		}
		28 = {
			add_building_construction = {
				type = bunker
				level = 1
				province = 549
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 2
				province = 9503
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 6529
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 2
				province = 678
				instant_build = yes
			}
		}
		set_country_flag = GCW_heydrich_forts_done
		if = {
			limit = {
				has_country_flag = ai_heydrich_build_up
				check_variable = { GER_Heydrich_Influence > GER_Heydrich_Influence_limit }
			}
			activate_mission = GER_GCW_heydrich_build_up
		}
		else = {
			clr_country_flag = ai_heydrich_build_up
		}
	}
}

GCW_build_up_infantry_weapons = {
	custom_effect_tooltip = GCW_build_up_infantry_weapons_tt
	if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = bormann_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_bormann_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Bormann_infantry_weapons = 5000 }
		if = {
			limit = {
				has_country_flag = ai_bormann_build_up
				check_variable = { GER_Bormann_Influence > GER_Bormann_Influence_limit }
			}
			activate_mission = GER_GCW_bormann_build_up
		}
		else = {
			clr_country_flag = ai_bormann_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = goring_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_goring_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Goring_infantry_weapons = 5000 }
		if = {
			limit = {
				has_country_flag = ai_goring_build_up
				check_variable = { GER_Goring_Influence > GER_Goring_Influence_limit }
			}
			activate_mission = GER_GCW_goring_build_up
		}
		else = {
			clr_country_flag = ai_goring_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = speer_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_speer_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Speer_infantry_weapons = 5000 }
		if = {
			limit = {
				has_country_flag = ai_speer_build_up
				check_variable = { GER_Speer_Influence > GER_Speer_Influence_limit }
			}
			activate_mission = GER_GCW_speer_build_up
		}
		else = {
			clr_country_flag = ai_speer_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = heydrich_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_heydrich_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Heydrich_infantry_weapons = 5000 }
		if = {
			limit = {
				has_country_flag = ai_heydrich_build_up
				check_variable = { GER_Heydrich_Influence > GER_Heydrich_Influence_limit }
			}
			activate_mission = GER_GCW_heydrich_build_up
		}
		else = {
			clr_country_flag = ai_heydrich_build_up
		}
	}
}

GCW_build_up_heer_units = {
	custom_effect_tooltip = GCW_build_up_heer_units_tt
	if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = bormann_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_bormann_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Bormann_heer_units = 2 }
		if = {
			limit = {
				has_country_flag = ai_bormann_build_up
				check_variable = { GER_Bormann_Influence > GER_Bormann_Influence_limit }
			}
			activate_mission = GER_GCW_bormann_build_up
		}
		else = {
			clr_country_flag = ai_bormann_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = goring_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_goring_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Goring_heer_units = 2 }
		if = {
			limit = {
				has_country_flag = ai_goring_build_up
				check_variable = { GER_Goring_Influence > GER_Goring_Influence_limit }
			}
			activate_mission = GER_GCW_goring_build_up
		}
		else = {
			clr_country_flag = ai_goring_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = speer_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_speer_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Speer_heer_units = 2 }
		if = {
			limit = {
				has_country_flag = ai_speer_build_up
				check_variable = { GER_Speer_Influence > GER_Speer_Influence_limit }
			}
			activate_mission = GER_GCW_speer_build_up
		}
		else = {
			clr_country_flag = ai_speer_build_up
		}
	}
	else_if = {
		limit = {
			OR = {
				AND = {
					has_country_flag = heydrich_for_germany
					check_variable = { ai_check_temp = 0 }
				}
				AND = {
					has_country_flag = ai_heydrich_build_up
					check_variable = { ai_check_temp = 1 }
				}
			}
		}
		add_to_variable = { GCW_Heydrich_heer_units = 2 }
		if = {
			limit = {
				has_country_flag = ai_heydrich_build_up
				check_variable = { GER_Heydrich_Influence > GER_Heydrich_Influence_limit }
			}
			activate_mission = GER_GCW_heydrich_build_up
		}
		else = {
			clr_country_flag = ai_heydrich_build_up
		}
	}
}

GER_increase_legitimacy_small = {
	if = {
		limit = {
			has_country_flag = bormann_for_germany
		}
		GER_increase_legitimacy_small_bormann = yes
	}
	else_if = {
		limit = {
			has_country_flag = goring_for_germany
		}
		GER_increase_legitimacy_small_goring = yes
	}
	else_if = {
		limit = {
			has_country_flag = speer_for_germany
		}
		GER_increase_legitimacy_small_speer = yes
	}
	else_if = {
		limit = {
			has_country_flag = heydrich_for_germany
		}
		GER_increase_legitimacy_small_heydrich = yes
	}
}

GER_increase_legitimacy_large = {
	if = {
		limit = {
			has_country_flag = bormann_for_germany
		}
		GER_increase_legitimacy_large_bormann = yes
	}
	else_if = {
		limit = {
			has_country_flag = goring_for_germany
		}
		GER_increase_legitimacy_large_goring = yes
	}
	else_if = {
		limit = {
			has_country_flag = speer_for_germany
		}
		GER_increase_legitimacy_large_speer = yes
	}
	else_if = {
		limit = {
			has_country_flag = heydrich_for_germany
		}
		GER_increase_legitimacy_large_heydrich = yes
	}
}

GER_increase_legitimacy_small_bormann = {
	custom_effect_tooltip = GER_increase_legitimacy_small_bormann_tt
	add_to_variable = { GER_Bormann_Influence = 5 }
}
GER_increase_legitimacy_small_goring = {
	custom_effect_tooltip = GER_increase_legitimacy_small_goring_tt
	add_to_variable = { GER_Goring_Influence = 5 }
}
GER_decrease_legitimacy_small_goring = {
	custom_effect_tooltip = GER_decrease_legitimacy_small_goring_tt
	add_to_variable = { GER_Goring_Influence = -5 }
}
GER_increase_legitimacy_small_speer = {
	custom_effect_tooltip = GER_increase_legitimacy_small_speer_tt
	add_to_variable = { GER_Speer_Influence = 5 }
}
GER_increase_legitimacy_small_heydrich = {
	custom_effect_tooltip = GER_increase_legitimacy_small_heydrich_tt
	add_to_variable = { GER_Heydrich_Influence = 5 }
}

GER_increase_legitimacy_large_bormann = {
	custom_effect_tooltip = GER_increase_legitimacy_large_bormann_tt
	add_to_variable = { GER_Bormann_Influence = 10 }
}
GER_increase_legitimacy_large_goring = {
	custom_effect_tooltip = GER_increase_legitimacy_large_goring_tt
	add_to_variable = { GER_Goring_Influence = 10 }
}
GER_decrease_legitimacy_large_goring = {
	custom_effect_tooltip = GER_decrease_legitimacy_large_goring_tt
	add_to_variable = { GER_Goring_Influence = -10 }
}
GER_increase_legitimacy_large_speer = {
	custom_effect_tooltip = GER_increase_legitimacy_large_speer_tt
	add_to_variable = { GER_Speer_Influence = 10 }
}
GER_increase_legitimacy_large_heydrich = {
	custom_effect_tooltip = GER_increase_legitimacy_large_heydrich_tt
	add_to_variable = { GER_Heydrich_Influence = 10 }
}

GER_decrease_legitimacy_small_bormann = {
	custom_effect_tooltip = GER_decrease_legitimacy_small_bormann_tt
	add_to_variable = { GER_Bormann_Influence = -5 }
}
GER_decrease_legitimacy_small_speer = {
	custom_effect_tooltip = GER_decrease_legitimacy_small_speer_tt
	add_to_variable = { GER_Speer_Influence = -5 }
}
GER_decrease_legitimacy_small_heydrich = {
	custom_effect_tooltip = GER_decrease_legitimacy_small_heydrich_tt
	add_to_variable = { GER_Heydrich_Influence = -5 }
}

GER_decrease_legitimacy_large_bormann = {
	custom_effect_tooltip = GER_decrease_legitimacy_large_bormann_tt
	add_to_variable = { GER_Bormann_Influence = -10 }
}

GER_decrease_legitimacy_large_speer = {
	custom_effect_tooltip = GER_increase_legitimacy_large_speer_tt
	add_to_variable = { GER_Speer_Influence = -10 }
}
GER_decrease_legitimacy_large_heydrich = {
	custom_effect_tooltip = GER_increase_legitimacy_large_heydrich_tt
	add_to_variable = { GER_Heydrich_Influence = -10 }
}

GCW_intialise_legitimacy = {
	set_country_flag = GER_GCW_mechanic_flag
	set_temp_variable = { GCW_temp_legitimacy = GCW_legitimacy }
	divide_temp_variable = { GCW_temp_legitimacy = -200 }
	add_to_temp_variable = { GCW_temp_legitimacy = 0.4 }
	set_variable = { GCW_legitimacy_training_time_factor = GCW_temp_legitimacy }
	multiply_temp_variable = { GCW_temp_legitimacy = -1 }
	set_variable = { GCW_legitimacy_production_factory_max_efficiency_factor = GCW_temp_legitimacy }
	add_to_temp_variable = { GCW_temp_legitimacy = 0.1 }
	set_variable = { GCW_legitimacy_planning_speed = GCW_temp_legitimacy }
	add_to_temp_variable = { GCW_temp_legitimacy = 0.05 }
	set_variable = { GCW_legitimacy_political_power_factor = GCW_temp_legitimacy }
	add_to_temp_variable = { GCW_temp_legitimacy = 0.25 }
	divide_temp_variable = { GCW_temp_legitimacy = 2 }
	set_variable = { GCW_legitimacy_compliance_gain = GCW_temp_legitimacy }
	add_dynamic_modifier = { modifier = GCW_legitimacy_dynamic_modifier }
}

GCW_increase_legitimacy_small = {
	custom_effect_tooltip = GCW_increase_legitimacy_small_tt
	add_to_variable = { GCW_legitimacy = 5 }
	clamp_variable = { var = GCW_legitimacy min = 0 max = 100 }
	add_to_variable = { GCW_legitimacy_training_time_factor = -0.05 }
	clamp_variable = { var = GCW_legitimacy_training_time_factor min = -0.1 max = 0.4 }
	add_to_variable = { GCW_legitimacy_production_factory_max_efficiency_factor = 0.05 }
	clamp_variable = { var = GCW_legitimacy_production_factory_max_efficiency_factor min = -0.4 max = 0.1 }
	add_to_variable = { GCW_legitimacy_planning_speed = 0.05 }
	clamp_variable = { var = GCW_legitimacy_planning_speed min = -0.3 max = 0.2 }
	add_to_variable = { GCW_legitimacy_political_power_factor = 0.05 }
	clamp_variable = { var = GCW_legitimacy_political_power_factor min = -0.25 max = 0.25 }
	add_to_variable = { GCW_legitimacy_compliance_gain = 0.0125 }
	clamp_variable = { var = GCW_legitimacy_compliance_gain min = 0 max = 0.25 }
}
GCW_increase_legitimacy_large = {
	custom_effect_tooltip = GCW_increase_legitimacy_large_tt
	add_to_variable = { GCW_legitimacy = 10 }
	clamp_variable = { var = GCW_legitimacy min = 0 max = 100 }
	add_to_variable = { GCW_legitimacy_training_time_factor = -0.10 }
	clamp_variable = { var = GCW_legitimacy_training_time_factor min = -0.1 max = 0.4 }
	add_to_variable = { GCW_legitimacy_production_factory_max_efficiency_factor = 0.10 }
	clamp_variable = { var = GCW_legitimacy_production_factory_max_efficiency_factor min = -0.4 max = 0.1 }
	add_to_variable = { GCW_legitimacy_planning_speed = 0.10 }
	clamp_variable = { var = GCW_legitimacy_planning_speed min = -0.3 max = 0.2 }
	add_to_variable = { GCW_legitimacy_political_power_factor = 0.10 }
	clamp_variable = { var = GCW_legitimacy_political_power_factor min = -0.25 max = 0.25 }
	add_to_variable = { GCW_legitimacy_compliance_gain = 0.025 }
	clamp_variable = { var = GCW_legitimacy_compliance_gain min = 0 max = 0.25 }
}
GCW_decrease_legitimacy_small = {
	custom_effect_tooltip = GCW_decrease_legitimacy_small_tt
	subtract_from_variable = { GCW_legitimacy = 5 }
	clamp_variable = { var = GCW_legitimacy min = 0 max = 100 }
	subtract_from_variable = { GCW_legitimacy_training_time_factor = -0.05 }
	clamp_variable = { var = GCW_legitimacy_training_time_factor min = -0.1 max = 0.4 }
	subtract_from_variable = { GCW_legitimacy_production_factory_max_efficiency_factor = 0.05 }
	clamp_variable = { var = GCW_legitimacy_production_factory_max_efficiency_factor min = -0.4 max = 0.1 }
	subtract_from_variable = { GCW_legitimacy_planning_speed = 0.05 }
	clamp_variable = { var = GCW_legitimacy_planning_speed min = -0.3 max = 0.2 }
	subtract_from_variable = { GCW_legitimacy_political_power_factor = 0.05 }
	clamp_variable = { var = GCW_legitimacy_political_power_factor min = -0.25 max = 0.25 }
	add_to_variable = { GCW_legitimacy_compliance_gain = -0.0125 }
	clamp_variable = { var = GCW_legitimacy_compliance_gain min = 0 max = 0.25 }
}
GCW_decrease_legitimacy_large = {
	custom_effect_tooltip = GCW_decrease_legitimacy_large_tt
	subtract_from_variable = { GCW_legitimacy = 10 }
	clamp_variable = { var = GCW_legitimacy min = 0 max = 100 }
	subtract_from_variable = { GCW_legitimacy_training_time_factor = -0.10 }
	clamp_variable = { var = GCW_legitimacy_training_time_factor min = -0.1 max = 0.4 }
	subtract_from_variable = { GCW_legitimacy_production_factory_max_efficiency_factor = 0.10 }
	clamp_variable = { var = GCW_legitimacy_production_factory_max_efficiency_factor min = -0.4 max = 0.1 }
	subtract_from_variable = { GCW_legitimacy_planning_speed = 0.10 }
	clamp_variable = { var = GCW_legitimacy_planning_speed min = -0.3 max = 0.2 }
	subtract_from_variable = { GCW_legitimacy_political_power_factor = 0.10 }
	clamp_variable = { var = GCW_legitimacy_political_power_factor min = -0.25 max = 0.25 }
	add_to_variable = { GCW_legitimacy_compliance_gain = -0.025 }
	clamp_variable = { var = GCW_legitimacy_compliance_gain min = 0 max = 0.25 }
}

GCW_increase_influence_small = {
	custom_effect_tooltip = GCW_increase_influence_small_tt
	add_to_variable = { GCW_influence = 5 }
}
GCW_increase_influence_large = {
	custom_effect_tooltip = GCW_increase_influence_large_tt
	add_to_variable = { GCW_influence = 10 }
}
GCW_decrease_influence_small = {
	custom_effect_tooltip = GCW_decrease_influence_small_tt
	subtract_from_variable = { GCW_influence = 5 }
}
GCW_decrease_influence_large = {
	custom_effect_tooltip = GCW_decrease_influence_large_tt
	subtract_from_variable = { GCW_influence = 10 }
}

GCW_war_balancing_script_main = {
	if = { #stalemate for 2 months
		limit = {
			check_variable = { war_balancing_script_count < 8 }
		}
		GCW_war_balancing_script_1 = yes
	}
	else = { #BLITZKRIEG
		GCW_war_balancing_script_2 = yes
	}
	if = {
		limit = {
			check_variable = { war_balancing_script_count < 8 }
			check_variable = { war_balancing_script_count > 3 }
			HGR = {
				is_ai = yes
			}
		}
		HGR = {
			add_ideas = GCW_hidden_debuff_2
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_1
			}
		}
	}
	else_if = {
		limit = {
			check_variable = { war_balancing_script_count < 12 }
			HGR = {
				is_ai = yes
			}
		}
		HGR = {
			add_ideas = GCW_hidden_debuff_1
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_2
			}
			random_country_division = {
				destroy_unit = yes
			}
			set_equipment_fraction = 0.9
		}
	}
	else_if = {
		limit = {
			check_variable = { war_balancing_script_count < 20 }
			HGR = {
				is_ai = yes
			}
		}
		HGR = {
			add_ideas = GCW_hidden_debuff_1
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_2
			}
			random_country_division = {
				destroy_unit = yes
			}
			random_country_division = {
				destroy_unit = yes
			}
			set_equipment_fraction = 0.75
		}
	}
	else_if = {
		limit = {
			check_variable = { war_balancing_script_count > 19 }
			HGR = {
				is_ai = yes
			}
		}
		HGR = {
			add_ideas = GCW_too_late_TOO_LATE
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_2
				GCW_hidden_debuff_1
			}
			random_country_division = {
				destroy_unit = yes
			}
			random_country_division = {
				destroy_unit = yes
			}
			random_country_division = {
				destroy_unit = yes
			}
			set_equipment_fraction = 0.5
		}
	}
	if = {
		limit = {
			check_variable = { war_balancing_script_count < 8 }
			check_variable = { war_balancing_script_count > 3 }
			SGR = {
				is_ai = yes
			}
		}
		SGR = {
			add_ideas = GCW_hidden_debuff_2
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_1
			}
		}
	}
	else_if = {
		limit = {
			check_variable = { war_balancing_script_count < 12 }
			SGR = {
				is_ai = yes
			}
		}
		SGR = {
			add_ideas = GCW_hidden_debuff_1
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_2
			}
			random_country_division = {
				destroy_unit = yes
			}
			set_equipment_fraction = 0.9
		}
	}
	else_if = {
		limit = {
			check_variable = { war_balancing_script_count < 20 }
			SGR = {
				is_ai = yes
			}
		}
		SGR = {
			add_ideas = GCW_hidden_debuff_1
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_2
			}
			random_country_division = {
				destroy_unit = yes
			}
			random_country_division = {
				destroy_unit = yes
			}
			set_equipment_fraction = 0.75
		}
	}
	else_if = {
		limit = {
			check_variable = { war_balancing_script_count > 19 }
			SGR = {
				is_ai = yes
			}
		}
		SGR = {
			add_ideas = GCW_too_late_TOO_LATE
			remove_ideas = {
				GCW_hidden_debuff_3
				GCW_hidden_debuff_2
				GCW_hidden_debuff_1
			}
			random_country_division = {
				destroy_unit = yes
			}
			random_country_division = {
				destroy_unit = yes
			}
			random_country_division = {
				destroy_unit = yes
			}
			set_equipment_fraction = 0.5
		}
	}
	add_to_variable = { war_balancing_script_count = 1 }
}

GCW_war_balancing_script_1 = {
	for_each_scope_loop = {
		array = global.GCW_contenders

		add_to_variable = { global.GCW_average_num_controlled_states = num_controlled_states }
	}

	divide_variable = { global.GCW_average_num_controlled_states = global.GCW_contenders^num }
	round_variable = global.GCW_average_num_controlled_states

	for_each_scope_loop = {
		array = global.GCW_contenders

		set_temp_variable = { temp_num_controlled_states = num_controlled_states }
		subtract_from_temp_variable = { temp_num_controlled_states = global.GCW_average_num_controlled_states }

		if = {
			limit = {
				check_variable = { temp_num_controlled_states > 4 }
				is_ai = yes
			}
			add_ideas = GCW_hidden_debuff_1
			remove_ideas = {
				GCW_hidden_debuff_2
				GCW_hidden_debuff_3
			}
		}
		else_if = {
			limit = {
				check_variable = { temp_num_controlled_states > 2 }
				is_ai = yes
			}
			add_ideas = GCW_hidden_debuff_2
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_3
			}
		}
		else_if = {
			limit = {
				check_variable = { temp_num_controlled_states > 0 }
				is_ai = yes
			}
			add_ideas = GCW_hidden_debuff_3
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_2
			}
		}
		# player debuff
		else_if = {
			limit = {
				check_variable = { temp_num_controlled_states > 6 }
			}
			add_ideas = GCW_hidden_debuff_2
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_3
			}
		}
		else_if = {
			limit = {
				check_variable = { temp_num_controlled_states > 4 }
			}
			add_ideas = GCW_hidden_debuff_3
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_2
			}
		}
		else = {
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_2
				GCW_hidden_debuff_3
			}
		}
	}

	clear_variable = global.GCW_average_num_controlled_states
}

GCW_war_balancing_script_2 = {
	for_each_scope_loop = {
		array = global.GCW_contenders

		if = {
			limit = { is_ai = yes }
			add_to_variable = { global.GCW_average_surrender_progress = surrender_progress }
		}
	}

	multiply_variable = { global.GCW_average_surrender_progress = 100 }
	divide_variable = { global.GCW_average_surrender_progress = global.GCW_contenders^num }
	round_variable = global.GCW_average_surrender_progress
	divide_variable = { global.GCW_average_surrender_progress = 100 }

	for_each_scope_loop = {
		array = global.GCW_contenders

		set_temp_variable = { temp_surrender_progress = surrender_progress }
		subtract_from_temp_variable = { temp_surrender_progress = global.GCW_average_surrender_progress }

		if = {
			limit = {
				check_variable = { temp_surrender_progress > 0.30 }
			}
			add_ideas = GCW_hidden_debuff_1
			remove_ideas = {
				GCW_hidden_debuff_2
				GCW_hidden_debuff_3
			}
		}
		else_if = {
			limit = {
				check_variable = { temp_surrender_progress > 0.15 }
			}
			add_ideas = GCW_hidden_debuff_2
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_3
			}
		}
		else_if = {
			limit = {
				check_variable = { temp_surrender_progress > 0 }
			}
			add_ideas = GCW_hidden_debuff_3
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_2
			}
		}
		else = {
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_2
				GCW_hidden_debuff_3
			}
		}

		if = {
			limit = { is_ai = no }
			remove_ideas = {
				GCW_hidden_debuff_1
				GCW_hidden_debuff_2
				GCW_hidden_debuff_3
			}
		}
	}

	clear_variable = global.GCW_average_surrender_progress
}

anti_heydrich_pact_script = {
	for_each_scope_loop = {
		array = global.GCW_contenders

		if = {
			limit = { has_country_flag = anti_heydrich_pact }
			every_owned_state = {
				limit = {
					NOT = { is_controlled_by = PREV }
					NOT = { is_controlled_by = HGR }
				}
				PREV = { set_state_controller = PREV }
			}
		}
	}

	if = {
		limit = { country_exists = SGR }
		SGR = {
			create_faction = anti_heydrich_pact_faction
			if = {
				limit = {
					country_exists = BGR
					BGR = { has_country_flag = anti_heydrich_pact }
				}
				BGR = { white_peace = SGR }
				SGR = { add_to_faction = BGR }
			}
			if = {
				limit = {
					country_exists = GGR
					GGR = { has_country_flag = anti_heydrich_pact }
				}
				GGR = { white_peace = SGR }
				if = {
					limit = {
						country_exists = BGR
						BGR = { has_country_flag = anti_heydrich_pact }
					}
					GGR = { white_peace = BGR }
				}
				SGR = { add_to_faction = GGR }
			}
			every_country = {
				limit = { is_ai = no }
				news_event = { id = WORLD_REICH.11 days = 1 }
			}
		}
	}
	else_if = {
		limit = { country_exists = BGR }
		BGR = {
			create_faction = anti_heydrich_pact_faction
			if = {
				limit = {
					country_exists = GGR
					GGR = { has_country_flag = anti_heydrich_pact }
				}
				GGR = { white_peace = BGR }
				BGR = { add_to_faction = GGR }
			}
			every_country = {
				limit = { is_ai = no }
				news_event = { id = WORLD_REICH.11 days = 1 }
			}
		}
	}
	set_global_flag = anti_heydrich_pact_formed

	# Faction Status
	BGR = { add_ideas = Anti_Heydrich_Pact }
	SGR = { add_ideas = Anti_Heydrich_Pact }
	GGR = { add_ideas = Anti_Heydrich_Pact }
}

setup_speer_gcw_navy = {
	GER = {
		transfer_ship = {
			prefer_name = "Z11 'Bernd von Arnim'"
			type = destroyer
			target = SGR
		}
		transfer_ship = {
			prefer_name = "Z26"
			type = destroyer
			target = SGR
		}
		transfer_ship = {
			prefer_name = "K20"
			type = corvette
			target = SGR
		}
		transfer_ship = {
			prefer_name = "K21"
			type = corvette
			target = SGR
		}
		transfer_ship = {
			prefer_name = "K26"
			type = corvette
			target = SGR
		}
		transfer_ship = {
			prefer_name = "F24"
			type = frigate
			target = SGR
		}
		transfer_ship = {
			prefer_name = "F25"
			type = frigate
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-4323"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-4333"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-4340"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-4342"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-4341"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-901"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-902"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-903"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-904"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-905"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-906"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-926"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-927"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "U-928"
			type = submarine
			target = SGR
		}
		transfer_ship = {
			prefer_name = "Blücher"
			type = cruiser
			target = SGR
		}
		transfer_ship = {
			prefer_name = "Admiral Hipper"
			type = cruiser
			target = SGR
		}
		transfer_ship = {
			prefer_name = "Köln"
			type = light_cruiser
			target = SGR
		}
		transfer_ship = {
			prefer_name = "F45"
			type = frigate
			target = SGR
		}
		transfer_ship = {
			prefer_name = "F47"
			type = frigate
			target = SGR
		}
		transfer_ship = {
			prefer_name = "F48"
			type = frigate
			target = SGR
		}
		transfer_ship = {
			prefer_name = "F49"
			type = frigate
			target = SGR
		}
		transfer_ship = {
			prefer_name = "F6"
			type = frigate
			target = SGR
		}
	}
}

setup_goering_gcw_navy = {
	GER = {
		transfer_ship = {
			prefer_name = "Tirpitz"
			type = battleship
			target = GGR
		}
		transfer_ship = {
			prefer_name = "Ludendorff"
			type = battleship
			target = GGR
		}
		transfer_ship = {
			prefer_name = "Z21 'Wilhelm Heidkamp'"
			type = destroyer
			target = GGR
		}
		transfer_ship = {
			prefer_name = "Z19 'Hermann Künne'"
			type = destroyer
			target = GGR
		}
		transfer_ship = {
			prefer_name = "Z17 'Diether von Roeder'"
			type = destroyer
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-3122"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-3123"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-3124"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-3125"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-3126"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-4365"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-4463"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "U-4264"
			type = submarine
			target = GGR
		}
		transfer_ship = {
			prefer_name = "F44"
			type = frigate
			target = GGR
		}
		transfer_ship = {
			prefer_name = "F46"
			type = frigate
			target = GGR
		}
		transfer_ship = {
			prefer_name = "K66"
			type = corvette
			target = GGR
		}
		transfer_ship = {
			prefer_name = "K67"
			type = corvette
			target = GGR
		}
		transfer_ship = {
			prefer_name = "K69"
			type = corvette
			target = GGR
		}
	}
}

setup_heydrich_gcw_navy = {
	GER = {
		transfer_ship = {
			prefer_name = "Von Hohenheim"
			type = cruiser
			target = HGR
		}
		transfer_ship = {
			prefer_name = "Schwarze Sonne"
			type = cruiser
			target = HGR
		}
		transfer_ship = {
			prefer_name = "U-926"
			type = submarine
			target = HGR
		}
		transfer_ship = {
			prefer_name = "U-927"
			type = submarine
			target = HGR
		}
		transfer_ship = {
			prefer_name = "U-928"
			type = submarine
			target = HGR
		}
		transfer_ship = {
			prefer_name = "K29"
			type = corvette
			target = HGR
		}
		transfer_ship = {
			prefer_name = "K24"
			type = corvette
			target = HGR
		}
		transfer_ship = {
			prefer_name = "K22"
			type = corvette
			target = HGR
		}
		transfer_ship = {
			prefer_name = "F29"
			type = frigate
			target = HGR
		}
		transfer_ship = {
			prefer_name = "F32"
			type = corvette
			target = HGR
		}
		transfer_ship = {
			prefer_name = "K66"
			type = corvette
			target = HGR
		}
		transfer_ship = {
			prefer_name = "K67"
			type = corvette
			target = HGR
		}
	}
}

setup_bormann_gcw_navy = {
	CRI = {
		transfer_ship = {
			prefer_name = "U-4267"
			type = submarine
			target = GER
		}
		transfer_ship = {
			prefer_name = "U-4268"
			type = submarine
			target = GER
		}
		transfer_ship = {
			prefer_name = "U-4269"
			type = submarine
			target = GER
		}
		transfer_ship = {
			prefer_name = "U-4270"
			type = submarine
			target = GER
		}
		transfer_ship = {
			prefer_name = "U-4479"
			type = submarine
			target = GER
		}
		transfer_ship = {
			prefer_name = "Seydlitz"
			type = cruiser
			target = GER
		}
		transfer_ship = {
			prefer_name = "Drache"
			type = frigate
			target = GER
		}
		transfer_ship = {
			prefer_name = "Brummer"
			type = frigate
			target = GER
		}
		transfer_ship = {
			prefer_name = "K109"
			type = corvette
			target = GER
		}
		transfer_ship = {
			prefer_name = "Z5 'Paul Jacobi'"
			type = destroyer
			target = GER
		}
		transfer_ship = {
			prefer_name = "K103"
			type = corvette
			target = GER
		}
		transfer_ship = {
			prefer_name = "K107"
			type = corvette
			target = GER
		}
		transfer_ship = {
			prefer_name = "K105"
			type = corvette
			target = GER
		}
	}
}