USA_Slavery_Debate_Decision_Category = {
	USA_Slavery_Debate_Rising_Tensions = {
		icon = generic_civil_support

		allowed = { always = no }
		
		available = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = USA_Slavery_Debate_Rising_Tensions_tt1
					check_variable = { USA_Slavery_Debate_Tension < 1 }
				}
				custom_trigger_tooltip = {
					tooltip = USA_Slavery_Debate_Rising_Tensions_tt2
					check_variable = { USA_Slavery_Debate_Tension > 99 }
				}
			}
		}

		activation = { always = no }
		days_mission_timeout = 60
		
		timeout_effect = {
			# Leanings
			set_temp_variable = { USA_Slavery_Debate_Leaning_Change = USA_Slavery_Debate_StateSD_Count }
			USA_Slavery_Debate_Leaning_Modify = yes

			# Tensions - consolidated if/else chain
			if = {
				limit = {
					OR = {
						check_variable = { USA_Slavery_Debate_Leaning > 30 }
						check_variable = { USA_Slavery_Debate_Leaning < -30 }
					}
				}
				set_temp_variable = { USA_Slavery_Debate_Tension_Change = 3 }
			}
			else_if = {
				limit = {
					OR = {
						check_variable = { USA_Slavery_Debate_Leaning > 15 }
						check_variable = { USA_Slavery_Debate_Leaning < -15 }
					}
				}
				set_temp_variable = { USA_Slavery_Debate_Tension_Change = 2 }
			}
			else = {
				set_temp_variable = { USA_Slavery_Debate_Tension_Change = 1 }
			}
			
			USA_Slavery_Debate_Tension_Modify = yes
			
			hidden_effect = {
				if = {
					limit = { has_idea = usa_slavery_law }
					activate_mission = USA_Slavery_Debate_Rising_Tensions
				}
				else = {
					USA_Slavery_Debate_Remove = yes
				}
			}
		}
		
		complete_effect = {
			if = {
				limit = { check_variable = { USA_Slavery_Debate_Tension > 99 } }
				set_global_flag = ACW_American_Civil_War_Start
				
				# Simplified dual revolt logic
				if = {
					limit = { 
						check_variable = { USA_Slavery_Debate_Leaning < 15 } 
						check_variable = { USA_Slavery_Debate_Leaning > -15 }
					}
					news_event = usa_slavery_debate.47 # Southerners Revolt
					news_event = usa_slavery_debate.48 # Northerners Revolt
				}
				else_if = {
					limit = { check_variable = { USA_Slavery_Debate_Leaning < 15 } }
					news_event = usa_slavery_debate.47 # Southerners Revolt
				}
				else = {
					news_event = usa_slavery_debate.48 # Northerners Revolt
				}
			}
			else = {
				set_global_flag = ACW_American_Civil_War_Avoided
			}
			USA_Slavery_Debate_Remove = yes
		}
	}
	
	USA_Slavery_Debate_Oregon_Statehood_Mission = {
		icon = power_struggle
		allowed = { always = no }
		
		available = { 
			385 = { is_core_of = ROOT }
		}

		days_mission_timeout = 240
		is_good = yes
		highlight_states = { state = 385 }

		timeout_effect = {
			add_state_core = 385
			hidden_effect = {
				add_state_core = 1289
				set_country_flag = USA_Add_State_Manual_Flag
			}
		}
	}
	
	USA_Slavery_Debate_Kansas_Statehood_Mission = {
		icon = power_struggle
		allowed = { always = no }
		
		available = { 
			383 = { is_core_of = ROOT }
		}

		days_mission_timeout = 240
		is_good = yes
		highlight_states = { state = 383 }

		timeout_effect = {
			add_state_core = 383
			hidden_effect = {
				add_state_core = 1052
				add_state_core = 1296
				set_country_flag = USA_Add_State_Manual_Flag
			}
		}
	}
	
	USA_Slavery_Debate_Moderate_Voice = {
		icon = generic_political_discourse
		allowed = { always = no }

		available = { has_country_flag = USA_Slavery_Debate_Ongoing }

		ai_will_do = {
			base = 8
			modifier = {
				factor = 12.5
				check_variable = { USA_Slavey_Debate_Tension > 80 }
			}
		}

		cost = 20
		days_re_enable = 21

		complete_effect = {
			set_temp_variable = { USA_Slavery_Debate_Tension_Change = -1 }
			USA_Slavery_Debate_Tension_Modify = yes
			
			# Simplified leaning adjustment
			if = {
				limit = { check_variable = { USA_Slavery_Debate_Leaning > 5 } }
				set_temp_variable = { USA_Slavery_Debate_Leaning_Change = -1 }
				USA_Slavery_Debate_Leaning_Modify = yes
			}
			else_if = {
				limit = { check_variable = { USA_Slavery_Debate_Leaning < -5 } }
				set_temp_variable = { USA_Slavery_Debate_Leaning_Change = 1 }
				USA_Slavery_Debate_Leaning_Modify = yes
			}
		}
	}
	
	USA_Election_of_1860_Mission = {
		icon = generic_break_treaty
		allowed = { always = no }
		activation = { always = no }
		fire_only_once = yes

		available = {
			custom_trigger_tooltip = {
				tooltip = eoanb_usa_is_still_democracy_tt
				OR = {
					has_government = autocracy
					has_government = fundamentalism
					has_government = chauvinist_populism
					has_government = ideology_radical_socialism
				}
			}
		}

		days_mission_timeout = 1274

		timeout_effect = {
			country_event = usa_slavery_debate.12
			hidden_effect = {
				complete_national_focus = USA_Focus_ACW_Election_1860
				activate_mission = USA_Election_of_1864_Mission
			}
		}
	}
	
	USA_Election_of_1864_Mission = {
		icon = generic_break_treaty
		allowed = { always = no }
		activation = { always = no }
		fire_only_once = yes

		available = {
			custom_trigger_tooltip = {
				tooltip = eoanb_usa_is_still_democracy_tt
				OR = {
					has_government = autocracy
					has_government = fundamentalism
					has_government = chauvinist_populism
					has_government = ideology_radical_socialism
					NOT = { has_country_flag = USA_Slavery_Debate_Ongoing }
				}
			}
		}

		days_mission_timeout = 1460
		timeout_effect = { country_event = usa_slavery_debate.200 }
	}
}

#American Civil War
ACW_American_Civil_War_Decisions = {
	eoanb_decision_acw_brewing = {
		icon = generic_political_discourse
		allowed = { always = no }
		available = { always = no }
		activation = { always = no }

		days_mission_timeout = 96
		
		timeout_effect = {
			custom_effect_tooltip = eoanb_decision_acw_brewing_tt
			if = {
				limit = { tag = USA }
				news_event = acw_generic.9
			}
		}
	}
	
	eoanb_decision_acw_reform_west_point1 = {
		icon = power_struggle
		allowed = { always = no }
		
		available = { has_idea = USA_Spirit_West_Point_Napoleonic_Thought1 }
		visible = { has_idea = USA_Spirit_West_Point_Napoleonic_Thought1 }

		ai_will_do = { base = 50 }

		cost = 300
		custom_cost_trigger = { has_army_experience > 299.9 }
		custom_cost_text = army_experience_more_than_299

		days_remove = 180
		
		complete_effect = { army_experience = -300 }
		
		remove_effect = {
			swap_ideas = {
				remove_idea = USA_Spirit_West_Point_Napoleonic_Thought1
				add_idea = USA_Spirit_West_Point_Napoleonic_Thought2
			}
			activate_decision = eoanb_decision_acw_reform_west_point2
		}
	}
	
	eoanb_decision_acw_reform_west_point2 = {
		icon = power_struggle
		allowed = { always = no }
		
		available = { has_idea = USA_Spirit_West_Point_Napoleonic_Thought2 }
		visible = { has_idea = USA_Spirit_West_Point_Napoleonic_Thought2 }

		ai_will_do = { base = 50 }

		cost = 300
		custom_cost_trigger = { has_army_experience > 299.9 }
		custom_cost_text = army_experience_more_than_299

		days_remove = 180
		
		complete_effect = { army_experience = -300 }
		
		remove_effect = {
			swap_ideas = {
				remove_idea = USA_Spirit_West_Point_Napoleonic_Thought2
				add_idea = USA_Spirit_West_Point_Napoleonic_Thought3
			}
		}
	}
	
	# CSA surrender decisions - simplified state checks
	eoanb_decision_acw_csa_surrender_to_usa_union = {
		icon = generic_political_discourse
		allowed = { always = no }
		activation = { always = no }
		is_good = yes

		available = {
			date > 1862.7.1
			CSA = { has_country_flag = ACW_Union_Freeing_Slaves }
			
			# Consolidated state control checks
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_tx_tt
				375 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_la_tt
				371 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ar_tt
				372 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_tn_tt
				368 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ms_tt
				370 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ab_tt
				367 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_fl_tt
				366 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ga_tt
				365 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_sc_tt
				364 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_nc_tt
				363 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_va_tt
				362 = { is_owned_by = CSA is_controlled_by = USA }
			}
		}

		days_mission_timeout = 365

		timeout_effect = {
			hidden_effect = {
				if = {
					limit = { has_war_with = CSA }
					activate_mission = eoanb_decision_acw_csa_surrender_to_usa_union
				}
			}
		}
		
		complete_effect = {
			custom_effect_tooltip = acw_peace_deal.1.t
			complete_national_focus = USA_Focus_ACW_Soaring_Eagle
			hidden_effect = {
				if = {
					limit = { tag = USA }
					news_event = acw_peace_deal.1
				}
			}
		}
	}
	
	eoanb_decision_acw_csa_surrender_to_usa_dixie = {
		icon = generic_political_discourse
		allowed = { always = no }
		activation = { always = no }
		is_good = no

		available = {
			date > 1862.7.1
			CSA = { has_country_flag = ACW_Union_Freeing_Slaves }
			
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_tx_tt
				375 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_la_tt
				371 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ar_tt
				372 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_tn_tt
				368 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ms_tt
				370 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ab_tt
				367 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_fl_tt
				366 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_ga_tt
				365 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_sc_tt
				364 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_nc_tt
				363 = { is_owned_by = CSA is_controlled_by = USA }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_csa_surrender_to_usa_va_tt
				362 = { is_owned_by = CSA is_controlled_by = USA }
			}
		}

		days_mission_timeout = 365

		timeout_effect = {
			hidden_effect = {
				if = {
					limit = { has_war_with = USA }
					activate_mission = eoanb_decision_acw_csa_surrender_to_usa_dixie
				}
			}
		}
		
		complete_effect = {
			custom_effect_tooltip = acw_peace_deal.1.t
		}
	}

	# USA surrender decisions
	eoanb_decision_acw_usa_surrender_to_csa_union = {
		icon = generic_political_discourse
		allowed = { always = no }
		is_good = no
		fire_only_once = yes

		available = {
			date > 1862.1.1
			
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_mo_tt
				373 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_il_tt
				395 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_in_tt
				396 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_oh_tt
				261 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_md_tt
				361 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_pn_tt
				360 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_dc_tt
				1091 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_nj_tt
				359 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_ny_tt
				358 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_mc_tt
				393 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
		}

		days_mission_timeout = 365

		timeout_effect = {
			hidden_effect = {
				if = {
					limit = { has_war_with = CSA }
					activate_mission = eoanb_decision_acw_usa_surrender_to_csa_union
				}
			}
		}
		
		complete_effect = {
			complete_national_focus = USA_Focus_ACW_Broken_Eagle
			custom_effect_tooltip = acw_peace_deal.2.t
			hidden_effect = { news_event = acw_peace_deal.2 }
		}
	}
	
	eoanb_decision_acw_usa_surrender_to_csa_dixie = {
		icon = generic_political_discourse
		allowed = { always = no }
		is_good = yes
		fire_only_once = yes

		available = {
			date > 1862.1.1
			
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_mo_tt
				373 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_il_tt
				395 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_in_tt
				396 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_oh_tt
				261 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_md_tt
				361 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_pn_tt
				360 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_dc_tt
				1091 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_nj_tt
				359 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_ny_tt
				358 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_usa_surrender_to_csa_mc_tt
				393 = { is_owned_by = USA NOT = { is_controlled_by = USA } }
			}
		}

		days_mission_timeout = 365

		timeout_effect = {
			hidden_effect = {
				if = {
					limit = { has_war_with = USA }
					activate_mission = eoanb_decision_acw_usa_surrender_to_csa_dixie
				}
			}
		}
		
		complete_effect = {
			custom_effect_tooltip = acw_peace_deal.2.t
		}
	}

	# Procure Arms
	eoanb_decision_acw_confiscate_weapons = {
		icon = generic_infantry_arms

		allowed = {
			OR = {
				tag = USA
				tag = CSA
				tag = NEG
				tag = CAL
			}
		}

		available = {
			has_global_flag = ACW_American_Civil_War
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_at_war_tt
				has_war = yes
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_weapons_exhausted_tt
				check_variable = { acw_weapons_count_left > 0 }
			}
		}
		
		visible = {
			has_global_flag = ACW_American_Civil_War
			OR = {
				tag = NEG
				tag = CAL
				tag = USA
				tag = CSA
			}
		}

		ai_will_do = { 
			base = 10
			modifier = {
				add = 20
				OR = {
					stockpile_ratio = { archetype = infantry_equipment ratio < 1.0 }
					stockpile_ratio = { archetype = uniform_equipment ratio < 1.0 }
					stockpile_ratio = { archetype = cavalry_equipment ratio < 1.0 }
					stockpile_ratio = { archetype = cannon_equipment ratio < 1.0 }
					stockpile_ratio = { archetype = howitzer_equipment ratio < 1.0 }
				}
			} 
		}
		
		cost = 10
		custom_cost_trigger = { command_power > 9.9 }
		custom_cost_text = command_power_more_than_9

		days_re_enable = 7
		
		complete_effect = {
			ACW_Weapons_Count_Use = yes
			hidden_effect = { add_command_power = -10 }
		}
		
		remove_effect = {
			if = {
				limit = { tag = USA }
				add_equipment_to_stockpile = {
					type = infantry_equipment
					amount = 500
					producer = USA
				}
				add_equipment_to_stockpile = {
					type = uniform_equipment
					amount = 600
					producer = USA
				}
				random_list = {
					33 = {
						add_equipment_to_stockpile = {
							type = cannon_equipment
							amount = 40
							producer = USA
						}
					}
					33 = {
						add_equipment_to_stockpile = {
							type = howitzer_equipment
							amount = 40
							producer = USA
						}
					}
					33 = {
						add_equipment_to_stockpile = {
							type = cavalry_equipment
							amount = 150
							producer = USA
						}
					}
				}
			}
			else = {
				add_equipment_to_stockpile = {
					type = infantry_equipment
					amount = 360
					producer = ROOT
				}
				add_equipment_to_stockpile = {
					type = cannon_equipment
					amount = 32
					producer = ROOT
				}
				add_equipment_to_stockpile = {
					type = uniform_equipment
					amount = 480
					producer = ROOT
				}
			}
		}
	}
	
	# Draft - Equipment version
	eoanb_decision_acw_force_draft = {
		icon = nationalism

		allowed = {
			OR = {
				tag = USA
				tag = CSA
				tag = NEG
				tag = CAL
			}
		}

		available = {
			has_global_flag = ACW_American_Civil_War
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_at_war_tt
				has_war = yes
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_draft_exhaust_tt
				check_variable = { acw_draft_count_left > 0 }
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_weapons_exhausted_tt
				check_variable = { acw_weapons_count_left > 0 }
			}
		}
		
		visible = { has_global_flag = ACW_American_Civil_War }

		ai_will_do = {
			base = 20
			modifier = {
				factor = 0
				OR = {
					AND = { tag = USA ai_wants_divisions > 10 }
					AND = { tag = CSA ai_wants_divisions > 7 }
					AND = {
						OR = { tag = CAL tag = NEG }
						ai_wants_divisions > 5
					}
				}
			}
			modifier = {
				add = 50
				check_variable = { acw_draft_count_left > acw_weapons_count }
			}
			modifier = {
				add = -10
				NOT = { ai_wants_divisions > 5 }
			}
		}

		cost = 25
		custom_cost_trigger = { command_power > 24.9 }
		custom_cost_text = command_power_more_than_24
		
		days_re_enable = 7

		complete_effect = {
			ACW_Weapons_Count_Use = yes
			ACW_Draft_Count_Use = yes
			hidden_effect = { add_command_power = -25 }
		}
		
		remove_effect = {
			if = {
				limit = { tag = USA }
				add_manpower = 1300
				random_owned_controlled_state = {
					limit = { 
						is_fully_controlled_by = ROOT
						is_core_of = ROOT
					}
					random_list = {
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Militia Battalion\" division_template = \"Union Militia Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Infantry Regiment\" division_template = \"Union Infantry Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Zouave Regiment\" division_template = \"Union Zouave Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Cavalry Legion\" division_template = \"Union Cavalry Legion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Cavalry Battalion\" division_template = \"Union Cavalry Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Mounted Infantry\" division_template = \"Union Mounted Infantry\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Towed Artillery Battalion\" division_template = \"Union Towed Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Union Artillery Battalion\" division_template = \"Union Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						10 = {
							create_unit = {
								division = "name = \"Drafted Union Infantry Division\" division_template = \"Union Army\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
					}
				}
			}
			else_if = {
				limit = { tag = CSA }
				add_manpower = 1200
				random_owned_controlled_state = {
					limit = { 
						is_fully_controlled_by = ROOT
						is_core_of = ROOT
					}
					random_list = {
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Militia Battalion\" division_template = \"Confederate Militia Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Infantry Regiment\" division_template = \"Confederate Infantry Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Zouave Regiment\" division_template = \"Confederate Zouave Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Cavalry Legion\" division_template = \"Confederate Cavalry Legion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Cavalry Battalion\" division_template = \"Confederate Cavalry Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Mounted Infantry\" division_template = \"Confederate Mounted Infantry\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Towed Artillery Battalion\" division_template = \"Confederate Towed Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Confederate Artillery Battalion\" division_template = \"Confederate Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						10 = {
							create_unit = {
								division = "name = \"Drafted Confederate Infantry Division\" division_template = \"Confederate Army\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
					}
				}
			}
			else_if = {
				limit = { tag = NEG }
				add_manpower = 1200
				random_owned_controlled_state = {
					limit = { 
						is_fully_controlled_by = ROOT
						is_core_of = ROOT
					}
					random_list = {
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Militia Battalion\" division_template = \"Abolitionist Militia Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Infantry Regiment\" division_template = \"Abolitionist Infantry Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Zouave Regiment\" division_template = \"Abolitionist Zouave Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Cavalry Legion\" division_template = \"Abolitionist Cavalry Legion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Cavalry Battalion\" division_template = \"Abolitionist Cavalry Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Mounted Infantry\" division_template = \"Abolitionist Mounted Infantry\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Towed Artillery Battalion\" division_template = \"Abolitionist Towed Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Artillery Battalion\" division_template = \"Abolitionist Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						10 = {
							create_unit = {
								division = "name = \"Drafted Abolitionist Infantry Division\" division_template = \"Abolitionist Army\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
					}
				}
			}
			else_if = {
				limit = { tag = CAL }
				add_manpower = 800
				random_owned_controlled_state = {
					limit = { 
						is_fully_controlled_by = ROOT
						is_core_of = ROOT
					}
					random_list = {
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Militia Battalion\" division_template = \"Nortonist Militia Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Infantry Regiment\" division_template = \"Nortonist Infantry Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Zouave Regiment\" division_template = \"Nortonist Zouave Regiment\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Cavalry Legion\" division_template = \"Nortonist Cavalry Legion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Cavalry Battalion\" division_template = \"Nortonist Cavalry Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Mounted Infantry\" division_template = \"Nortonist Mounted Infantry\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Towed Artillery Battalion\" division_template = \"Nortonist Towed Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						9 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Artillery Battalion\" division_template = \"Nortonist Artillery Battalion\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
						10 = {
							create_unit = {
								division = "name = \"Drafted Nortonist Infantry Division\" division_template = \"Nortonist Army\" start_experience_factor = 0.1" 
								owner = ROOT
							}
						}
					}
				}
			}
		}
	}
	
	# Draft 2 - Manpower only
	eoanb_decision_acw_force_draft2 = {
		icon = nationalism

		allowed = {
			OR = {
				tag = USA
				tag = CSA
				tag = NEG
				tag = CAL
			}
		}

		available = {
			has_global_flag = ACW_American_Civil_War
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_at_war_tt
				has_war = yes
			}
			custom_trigger_tooltip = {
				tooltip = eoanb_decision_acw_draft_exhaust_tt
				check_variable = { acw_draft_count_left > 0 }
			}
		}
		
		visible = { has_global_flag = ACW_American_Civil_War }

		ai_will_do = {
			base = 20
			modifier = {
				factor = 0
				OR = {
					AND = { tag = USA has_manpower > 45000 }
					AND = { tag = CSA has_manpower > 20000 }
					AND = {
						OR = { tag = CAL tag = NEG }
						has_manpower > 10000
					}
				}
			}
		}

		cost = 25
		custom_cost_trigger = { command_power > 24.9 }
		custom_cost_text = command_power_more_than_24
		
		days_re_enable = 7

		complete_effect = {
			ACW_Draft_Count_Use = yes
			hidden_effect = { add_command_power = -25 }
		}
		
		remove_effect = {
			if = {
				limit = { tag = USA }
				add_manpower = 2600
			}
			else_if = {
				limit = { tag = CSA }
				add_manpower = 2400
			}
			else_if = {
				limit = { tag = NEG }
				add_manpower = 2400
			}
			else_if = {
				limit = { tag = CAL }
				add_manpower = 1600
			}
		}
	}
	
	eoanb_decision_acw_free_blacks = {
		icon = generic_political_discourse
		allowed = { tag = USA }

		available = {
			has_global_flag = ACW_American_Civil_War
			has_war_with = CSA
			CSA = {
				any_owned_state = { 
					is_controlled_by = ROOT
					NOT = { has_state_flag = ACW_Slavery_Forcefully_Freed_Slaves }
				}
			}
		}
		
		visible = {
			has_global_flag = ACW_American_Civil_War
			has_war_with = CSA
		}

		ai_will_do = { base = 10 }

		cost = 10
		custom_cost_trigger = { command_power > 9.9 }
		custom_cost_text = command_power_more_than_9

		days_re_enable = 21

		complete_effect = {
			# Generate random freed slaves amount (10000-20000)
			set_temp_variable = { acw_freed_slaves_temp = 10000 }
			set_temp_variable = { random_extra = random }
			multiply_temp_variable = { random_extra = 10000 }
			add_to_temp_variable = { acw_freed_slaves_temp = random_extra }
			
			set_temp_variable = { acw_freed_slaves_subtract = 0 }
			subtract_from_temp_variable = { acw_freed_slaves_subtract = acw_freed_slaves_temp }
			
			CSA = {
				random_owned_state = {
					limit = { 
						is_controlled_by = ROOT 
						NOT = { has_state_flag = ACW_Slavery_Forcefully_Freed_Slaves }
					}
					add_manpower = var:acw_freed_slaves_subtract
					set_state_flag = ACW_Slavery_Forcefully_Freed_Slaves
				}
			}
			
			random_owned_controlled_state = {
				limit = { is_core_of = ROOT }
				add_manpower = var:acw_freed_slaves_temp
			}
			
			hidden_effect = {
				add_manpower = var:acw_freed_slaves_temp
				random_list = {
					25 = {
						set_temp_variable = { acw_draft_count_change = 1 }
						ACW_Draft_Count_Get = yes
					}
					75 = {}
				}
			}
		}
	}
}
