#Documentation: "https://hoi4.paradoxwikis.com/On_actions"
on_actions = {

	#DESIGNED FOR 1857 START DATE - EFFECTS APPLY TO ALL START DATES, REMOVE EVERYTHING BUT GENERIC CONTENT WHEN SECOND START DATE IS ADDED
	on_startup = {
		effect = {
			every_country = {
				limit = {
					is_ai = no
				}
				set_country_flag = eoanb_startup_event_marker
			}
			every_country = {
				limit = {
					OR = {
						tag = NSC
						tag = TUS
						tag = MOD
						tag = PRM
						tag = PIE
						tag = AUS
						tag = FRA
						tag = SPR
						tag = MEX
						tag = BRA
					}
				}
				add_opinion_modifier = {
					target = PAP
					modifier = PAP_catholic_ties
				}
				reverse_add_opinion_modifier = {
					target = PAP
					modifier = PAP_catholic_ties
				}
			}
			PAP = {
				set_power_balance = {
					id = PAP_Balance_Of_Power_Papal_Influence
					left_side = PAP_BOP_Giacomo_Antonelli
					right_side = PAP_BOP_Xavier_de_Merode
				}
			}
			UCT = {
				set_global_flag = eoanb_gamerule_pandemic_disabled
				set_global_flag = eoanb_gamerule_rebel_disabled
				set_global_flag = eoanb_gamerule_economy_disabled
			}
			if = {
				limit = {
					has_start_date < 1858.05.11
				}
				SPR = {
					if = {
						limit = { has_template = "National Militia" }
						delete_unit_template_and_units = { division_template = "National Militia" }
					}
					division_template = {
						name = "National Militia"
						priority = 0
						division_names_group = SPR_STATE_MILITIA_01
						regiments = {
							irregular_infantry = { x = 0 y = 0 }
							irregular_infantry = { x = 1 y = 0 }
						}
						is_locked = yes
					}
				}
				AUS = { country_event = { id = austria.1 } } #German Renaming
				AUS = { country_event = { id = austria.2 } } #Starting Situation
				PRS = { country_event = { id = prussia.11 } } #German Renaming
				OTO = { country_event = { id = OTO_events.900 } } #Renaming Event
				OTO = {
					set_country_flag = OTO_bul_church_activate_flag
				}
				PIE = { country_event = { id = risorgimento.11 } }
				LVN = { country_event = { id = risorgimento.11 } }
				PRM = { country_event = { id = risorgimento.11 } }
				MOD = { country_event = { id = risorgimento.11 } }
				PAP = { country_event = { id = risorgimento.11 } }
				TUS = { country_event = { id = risorgimento.11 } }
				NSC = { country_event = { id = risorgimento.11 } }
				SAX = { country_event = { id = saxony.1 } } #Starting Situation: Domestic Policy
				SAX = { country_event = { id = saxony.2 } } #Starting Situation: Foreign Affairs
				SWE = { country_event = { id = eoanb_sweden.57 } } #Starting Situation: Railway Concessions
				GEO = { country_event = { id = rossiya.312 days = 1 } }
				SER = { country_event = { id = SERmisc.5 days = 1 } }
				BRA = { country_event = { id = brazil.900 days = 22 } }
				BRA = { country_event = { id = brazil.69 } }
				BRA = { country_event = { id = brazil.909 days = 243 } } #1858.8.1
				#FRA = { country_event = { id = nap_france.21 } }
				every_country = {
					country_event = { id = pssystem.16 days = 365 }
				}
				set_global_flag = eoanb_flag_ps_no_commies_until_allowed
				set_global_flag = eoanb_flag_no_flight_discovered
				729 = { add_dynamic_modifier = { modifier = dynmod_POR_macau_slaves } }
				##Add game rule here
				# if = {
					# limit = {
						# has_game_rule = {
							# rule = state_city_names
							# option = use_endonyms_state_city_names
						# }
					# }
					# set_global_flag = use_endonyms_state_city_names
					# random_country = {
						# limit = { is_ai = yes }
						# endonyms = yes
					# }
				# }
				# else = {
					set_global_flag = use_english_state_city_names
				# }
			}
		}
	}

	# country
	on_new_term_election = {
		random_events = {
			100 = election.1 #Generic Elections
		}
	}

	# Ace pilots
	# country, FROM = ace
	on_ace_promoted = {
		random_events = {
			100 = ace_event.1
			5 = ace_event.2
		}
	}

	# country, FROM = ace, PREV = enemy ace
	# This event fires twice, once for each ace.
	on_aces_killed_each_other = {
		random_events = {
			100 = ace_event.6
		}
	}

	# country, FROM = our ace,
	# PREV = enemy ace, has killed FROM
	on_ace_killed_by_ace = {
		random_events = {
			100 = ace_event.4
		}
	}

	# country, FROM = our ace,
	# PREV = enemy ace, killed by FROM
	on_ace_killed_other_ace = {
		random_events = {
			100 = ace_event.5
		}
	}

	# country, FROM = ace
	on_ace_killed = {
		random_events = {
			100 = ace_event.3
		}
	}

	# During justifying wargoals
	# triggered daily, so make sure there is a sink somewhere not firing events
	# country, FROM = target nation
	#on_justifying_wargoal_pulse = {
	#	effect = {
	#
	#	}
	#}

	#on_wargoal_expire = {
	#	effect = {
	#
	#	}
	#}

	#on_nuke_drop = {
	#	effect = {
	#
	#	}
	#}
	
	#on_daily = {
	#	effect = {
	#	
	#	}
	#}
	
	#on_weekly = {
	#	effect = {
	#	
	#	}
	#}
	
	#Can also be used with TAG, for example "on_monthly_TAG"
	#on_monthly = {
	#	effect = {
	#	
	#	}
	#}

	on_yearly = {
		effect = {
			if = {
				limit = {
					TAG = PRU
					729 = { has_dynamic_modifier = { modifier = dynmod_POR_macau_slaves } }
					NOT = { has_idea = full_equality }
				}
				country_event = { id = asiageneraldiplomatic.17 days = 1 random_days = 60 }
			}
			if = {
				limit = {
					TAG = DOM
					729 = { has_dynamic_modifier = { modifier = dynmod_POR_macau_slaves } }
					NOT = { has_idea = full_equality }
				}
				country_event = { id = asiageneraldiplomatic.18 days = 1 random_days = 60 }
			}
			if = {
				limit = {
					TAG = SPR
					owns_state = 315
					owns_state = 686
					owns_state = 1350
					729 = { has_dynamic_modifier = { modifier = dynmod_POR_macau_slaves } }
					NOT = { has_idea = full_equality }
				}
				country_event = { id = asiageneraldiplomatic.18 days = 1 random_days = 60 }
			}
			if = {
				limit = {
					TAG = RUS
					has_country_flag = eoanb_flag_RUS_colonizing_siberia
					NOT = { has_country_flag = eoanb_flag_RUS_colonizing_siberia_intensely }
				}
				country_event = { id = rossiya.351 days = 1 random_days = 60 }
			}
			if = {
				limit = {
					TAG = RUS
					has_country_flag = eoanb_flag_RUS_colonizing_siberia
					has_country_flag = eoanb_flag_RUS_colonizing_siberia_intensely
				}
				country_event = { id = rossiya.352 days = 1 random_days = 60 }
			}
			if = {
				limit = {
					TAG = RUS
					has_country_flag = eoanb_flag_RUS_colonizing_siberia
					is_historical_focus_on = no
					#Siberia keeps the cores after the uprising, so this check makes it only able to happen once
					NOT = { 577 = { is_core_of = SIB } }
				}
				random_list = {
					92 = {
						add_political_power = 0
					}
					8 = {
						country_event = { id = rossiya.353 days = 1 random_days = 300 }
					}
				}
			}
		}
	}

	# country random events
	#on_bi_yearly_pulse = {
	#	random_events =
	#}

	#on_five_year_pulse = {
	#
	#}

	#on_border_war_lost = {
	#	effect = {
	#
	#	}
	#}

	#FROM is country getting invited.
	#on_offer_join_faction = {
	#	effect = {
	#
	#	}
	#}

	#FROM is faction leader on join faction requests. THIS DOES NOT FIRE ON ADD_TO_FACTION EFFECT! USE ON_OFFER_JOIN_FACTION!
	#on_join_faction = {
	#	effect = {
	#
	#	}
	#}

	#FROM is war target
	on_declare_war = {
		effect = {
			if = {
				limit = {
					check_variable = {
						var = rival_country
						value = FROM.id
						compare = equals
					}
				}
				add_ideas = eoanbdiplomacy_rival_war
			}
		}
	}
	# When a new faction is formed
	#on_faction_formed = {
	#	effect = {
	#
	#	}
	#}

	#ROOT is winner #FROM is loser
	on_peaceconference_ended = {
		effect = {
			#if = {
			#	limit = {
			#		FROM = { has_country_flag = containment_target } #containment target defeated
			#		FROM = {
			#			NOT = {
			#				has_country_flag = containment_reperations
			#			}
			#		}
			#	}
			#	FROM = { set_country_flag = containment_reperations }
			#	FROM = { country_event = { id = contain.1 days = 0 } }
			#	ROOT = { clr_country_flag = containment_starter }
			#}
			#if = {
			#	limit = {
			#		ROOT = { has_country_flag = containment_target } #containment defeated
			#		ROOT = { has_defensive_war = no }
			#	}
			#	ROOT = { set_country_flag = containment_target_won }
			#	FROM = { clr_country_flag = containment_starter }
			#	ROOT = { country_event = { id = contain.3 days = 0 } }
			#	ROOT = { clr_country_flag = containment_target }
			#}
			if = {
				limit = {
					tag = NEG
					USA = { has_country_flag = USA_Radical_Coup }
					CAL = { exists = no }
					MHC = { exists = no }
				}
				ROOT = { drop_cosmetic_tag = yes }
				CAL = { drop_cosmetic_tag = yes }
				country_event = { id = acw.47 hours = 1 }
				#news_event = { id = acw_news.13 }#event not found
				every_state = {
					remove_core_of = MHC
	                remove_core_of = CAL
	                remove_core_of = NEG
	            }
			}
			# if = { ##FIX VIA EVENT OR MISSION
				# limit = {
					# tag = NEG
					# USA = { has_country_flag = USA_Radical_Coup }
					# CAL = { exists = yes }
				# }
				# declare_war_on = {
					# target = CAL
					# type = annex_everything
				# }
			# }
			# if = {
				# limit = {
					# tag = NEG
					# USA = { has_country_flag = USA_Radical_Coup }
					# MHC = { exists = yes }
				# }
				# declare_war_on = {
					# target = MHC
					# type = annex_everything
				# }
			# }
			if = {
				limit = {
					tag = CAL
					USA = { has_country_flag = USA_Radical_Coup }
					NEG = { exists = no }
					MHC = { exists = no }
				}
				ROOT = { drop_cosmetic_tag = yes }
				NEG = { drop_cosmetic_tag = yes }
				country_event = { id = acw.55 hours = 1 }
				#news_event = { id = acw_news.15 }#does not exist
				every_state = {
					remove_core_of = MHC
	                remove_core_of = CAL
	                remove_core_of = NEG
	            }
			}
			# if = {
				# limit = {
					# tag = CAL
					# USA = { has_country_flag = USA_Radical_Coup }
					# NEG = { exists = yes }
				# }
				# declare_war_on = {
					# target = NEG
					# type = annex_everything
				# }
			# }
			# if = {
				# limit = {
					# tag = CAL
					# USA = { has_country_flag = USA_Radical_Coup }
					# MHC = { exists = yes }
				# }
				# declare_war_on = {
					# target = MHC
					# type = annex_everything
				# }
			# }
			if = {
				limit = {
					tag = MHC
					USA = { has_country_flag = USA_Radical_Coup }
					NEG = { exists = no }
					CAL = { exists = no }
				}
				CAL = { drop_cosmetic_tag = yes }
				NEG = { drop_cosmetic_tag = yes }
				country_event = { id = acw.56 hours = 1 }
				news_event = { id = acw_news.16 }
				every_state = {
					remove_core_of = MHC
	                remove_core_of = CAL
	                remove_core_of = NEG
	            }
			}
			# if = {
				# limit = {
					# tag = MHC
					# USA = { has_country_flag = USA_Radical_Coup }
					# NEG = { exists = yes }
				# }
				# declare_war_on = {
					# target = NEG
					# type = annex_everything
				# }
			# }
			# if = {
				# limit = {
					# tag = MHC
					# USA = { has_country_flag = USA_Radical_Coup }
					# CAL = { exists = yes }
				# }
				# declare_war_on = {
					# target = CAL
					# type = annex_everything
				# }
			# }
			if = {
				limit = {
					FROM = {
						tag = USA
					}
					OR = {
						tag = CAL
						tag = NEG
						tag = MHC
					}
					USA = { has_country_flag = USA_Radical_Coup }
				}
				if = {
					limit = {
						NEG = { exists = yes }
					}
					NEG = {
						annex_country = {
							target = USA
							transfer_troops = no
						}
					}
				}
				else_if = {
					limit = {
						CAL = { exists = yes }
					}
					CAL = {
						annex_country = {
							target = USA
							transfer_troops = no
						}
					}
				}
				else_if = {
					limit = {
						MHC = { exists = yes }
					}
					MHC = {
						annex_country = {
							target = USA
							transfer_troops = no
						}
					}
				}
			}
			if = { #liberal mexico victory
				limit = {
					tag = MEX
					FROM = { tag = MEC }
				}
				MEC = {
					every_unit_leader = {
						LIMIT = {
							OR = {
								has_id = 18624
								has_id = 18628
								has_id = 18626
								has_id = 186211
							}
						}
						set_nationality = MXE
					}
        				remove_state_core = 277
        				remove_state_core = 474
        				remove_state_core = 475
        				remove_state_core = 476
        				remove_state_core = 481
        				remove_state_core = 482
        				remove_state_core = 483
        				remove_state_core = 484
        				remove_state_core = 1113
        				remove_state_core = 1114
        				remove_state_core = 477
        				remove_state_core = 479
        				remove_state_core = 480
        				remove_state_core = 1112
        				remove_state_core = 478
        				remove_state_core = 1124
        				remove_state_core = 485
				}
				MEX = {
					white_peace = ROOT
					annex_country = {
						target = MEC
					}
					increase_ps_by_one = yes
					country_event = { days = 1 id = mexico.12 }
					delete_unit_template_and_units = { division_template = "Local Militia" }
					set_capital = { state = 277 }
					set_global_flag = MEX_reform_war_end
					load_focus_tree = mexico_vic_liberal_ft
				}
			}
			if = { # conservitive mexico victory
				limit = {
					tag = MEC
					FROM = { tag = MEX }
				}
				MEX = {
					every_unit_leader = {
						LIMIT = {
							OR = {
								has_id = 18629
								has_id = 18625
								has_id = 186210
							}
						}
						set_nationality = USA
					}
        				remove_state_core = 277
        				remove_state_core = 474
        				remove_state_core = 475
        				remove_state_core = 476
        				remove_state_core = 481
        				remove_state_core = 482
        				remove_state_core = 483
        				remove_state_core = 484
        				remove_state_core = 1113
        				remove_state_core = 1114
        				remove_state_core = 477
        				remove_state_core = 479
        				remove_state_core = 480
        				remove_state_core = 1112
        				remove_state_core = 478
        				remove_state_core = 1124
        				remove_state_core = 485
				}
				MEC = {
					white_peace = ROOT
		            annex_country = {
		       	   		target = MEX
		           	}
					increase_ps_by_one = yes
					country_event = { days = 1 id = mexico.12 }
					delete_unit_template_and_units = { division_template = "Light Infantry" }
					set_capital = { state = 277 }
					set_global_flag = MEX_reform_war_end
				}
			}
			if = {
				limit={
					FROM={has_country_flag = true_china}
					ROOT={
						tag = QNG 
						tag = ROC 
						tag = PRC 
						tag = TAI 
						tag = GXC 
						tag = TAW 
						tag = PTH 
						tag = SIC 
						tag = YAL 
						tag = NIE 
						tag = BEI
					}
				}
				FROM={clr_country_flag = true_china}
				ROOT={set_country_flag = true_china}
			}
		}
	}

	# ROOT is capitulated country, FROM is winner
	on_capitulation = {
		effect = {
			if = {
				limit = {
					FRA = {
						has_country_flag = ITA_FRA_Divide_Italy_Yes
					}
					FROM = {
						OR = {
							tag = FRA
							tag = AUS
							tag = LVN
							tag = PAP
						}
					}
					ROOT = {
						OR = {
							tag = PIE
							tag = TUS
							tag = MOD
							tag = PRM
							tag = NSC
							tag = PAP
						}
					}
				}
				ITA_Division_of_italy_variable = yes
						if = {
							limit = {
								ROOT = {
									OR = {
										tag = PIE
										tag = TUS
										tag = MOD
										tag = PRM
									}
								}
							}
							LVN = {
								annex_country = {
									target = ROOT
								}
							}

						}
						if = {
							limit = {
								NOT = {
									PAP = {
										has_country_flag = ITA_PAP_Divide_Italy_Yes
									}
								}
								ROOT = {
									OR = {
										tag = NSC
										tag = PAP
									}
								}
							}
							FRA = {
								annex_country = {
									target = ROOT
								}
							}
						}
					if = {
						limit = {
							PAP = {
								has_country_flag = ITA_PAP_Divide_Italy_Yes
							}
							ROOT = {
								tag = NSC
							}
						}
						PAP = {
							annex_country = {
								target = NSC
							}
						}
					}
				}
			if = {
                limit = {
					FROM = { OR = { tag = PIE tag = TUS } }
					ROOT = { tag = NSC }
					NSC = {
						has_country_flag = NSC_Southern_rebellion_on_capitulation
					}
				}
				ROOT = {
					remove_state_core = 812
					remove_state_core = 117
					remove_state_core = 997
					remove_state_core = 156
					remove_state_core = 115
					clr_country_flag = NSC_Southern_rebellion_on_capitulation
				}
                FROM = {
					annex_country = {
						target = NSC
					}
				}
			}
			# if = {
				# limit = {
					# ROOT = { tag = PAP }
					# PAP = {
						# has_government = fundamentalism
					# }
				# }
				# FROM = {
					# PAP = {
						# every_owned_state = {
							# limit = {
								# NOT = {
									# state = 785
								# }
							# }
							# FROM = {
								# transfer_state = PREV
							# }	
							
						# }
					# }
				# }

			# }
	        # if = {
                # limit = {
					# FROM = { tag = RUS }
				    # ROOT = { tag = CIR }
                # }
                # FROM = { country_event = { id = caucasus.2 } } #event does not exist
            # }
	        #if = {
                #limit = {
					#ROOT = { tag = AUS }
					#FROM = { tag = PIE }
                #}
                #AUS = { country_event = AUSitalypolitics.1  }
            #}
			if = {#British win the Sepoy rebellion
                limit = {
					FROM = { tag = RAJ }
					ROOT = { tag = SRS }
                }
                FROM = { country_event = { id = britishindia.1 } }
            }
			if = {#spain wins, dom is annexed
				limit = {
					TAG = DOM
					FROM = { TAG = SPR }
				}
				SPR = {
					transfer_state = 319
					transfer_state = 1318
					set_country_flag = SPR_won_restoration
				}
				DOM = {
					remove_ideas = DOM_restoration_war2
					remove_ideas = DOM_restoration_war
				}
			}
			if = {#the USV wins vs venezuela
				limit = {
					TAG = VEN
					FROM = { TAG = USV }
				}
				USV = {
					drop_cosmetic_tag = yes
					country_event = venezuela.7
					annex_country = {
						target = VEN
						transfer_troops = no
					}
				}
			}
			if = {
				limit = {
					tag = PAR
					FROM = {
						OR = {
							tag = BRA
							tag = URC
							tag = URG
							tag = BOL
							tag = ARG	
						}
					}
					FROM = { controls_state = 1068 }
					PAR = { has_country_flag = Paraguayan_War }
				}
				FROM = { set_country_flag = Occupation_of_Asuncion }
				ROOT = { white_peace = FROM }
				PAR = { country_event = { id = par.15 } }
			}
			
			if = {
				limit = {
					tag = BRA
					FROM = {
						OR = {
							tag = PAR
							tag = ARG
							tag = URC
							tag = URG
							tag = BOL
						}
					}
					FROM = { controls_state = 1037 }
					PAR = { has_country_flag = Paraguayan_War }
				}
				FROM = { set_country_flag = Occupation_of_Rio }
				ROOT = { white_peace = FROM }
				PAR = { country_event = { id = par.16 } }
			}
			
			if = {
				limit = {
					TAG = ECU
					COL = { has_country_flag = COL_ecu_war }
					FROM = { TAG = COL }
				}
				COL = {
					annex_country = {
						target = ECU
						transfer_troops = no
					}
				}
			}
			if = {
                limit = {
					FROM = { 
						tag = OTO 
						has_country_flag = BOS_nevesinje
					}
					ROOT = { tag = BOS }
                }
                clr_country_flag = BOS_nevesinje
				FROM={
					annex_country = {
						target = BOS
						transfer_troops = no
					}
				}
            }
            if = {
				limit = {
					ROOT = { tag = USA }
					FROM = {
						original_tag = TEX
						has_government = traditional_conservatism
					}
				}
				FROM = {
					every_owned_state = {
						limit = {
							is_core_of = event_target:TEX_CIVWAR_CSA_target
						}
						remove_core_of = event_target:TEX_CIVWAR_CSA_target
						add_core_of = TEX
					}
				}
			}
			if = {
				limit = {
					ROOT = { tag = NKR }
					FROM = { 
						tag = KOR
						has_idea = KOR_Sadeo_Politics_idea
					}
				}
				FROM = {
					annex_country = {
						target = ROOT
					}
				}
			}
			if = {#BUE wins civil war
				limit = {
					ROOT = { tag = ARG }
					FROM = { 
						tag = BUE
					}
				}
				ROOT = { white_peace = FROM }
				FROM = {
					puppet = ARG
				}
			}
			if = {#ARG wins civil war
				limit = {
					ROOT = { tag = BUE }
					FROM = { 
						tag = ARG
					}
				}
				FROM = {
					country_event = {id=arg.1}
					annex_country = {
						target = ROOT
					}
				}
			}
		}
	}

	# ROOT is previously capitulated country
	#on_uncapitulation = {
	#	effect = {
	#
	#	}
	#}

	#on_government_change = {
	#	effect = {
	#		if = {
	#			limit = {
	#				has_government = fundamentalism
	#			}
	#			if = {
	#				limit = {
	#					OR = {
	#						has_idea = religion_catholic
	#						has_idea = religion_protestant
	#						has_idea = religion_mormon
	#						has_idea = religion_orthodox
	#						has_idea = religion_coptic
	#					}
	#				}
	#				set_country_leader_ideology = christian
	#			}
	#			else_if = {
	#				limit = {
	#					OR = {
	#						has_idea = religion_sunni
	#						has_idea = religion_shiite
	#						has_idea = religion_ibadi
	#					}
	#				}
	#				set_country_leader_ideology = islamist
	#			}
	#			else_if = {
	#				limit = {
	#					has_idea = religion_shinto
	#				}
	#				set_country_leader_ideology = shogunate
	#			}
	#			else_if = {
	#				limit = {
	#					has_idea = religion_shamanism
	#				}
	#				set_country_leader_ideology = shamanism
	#			}
	#			else = {
	#				set_country_leader_ideology = other_ideology
	#			}
	#		}	
	#	}
	#}

	#on_coup_succeeded = {
	#	effect = {
	#
	#	}
	#}

	#ROOT is winner #FROM gets annexed - This will also fire on_annex
	on_civil_war_end = {
		effect = {
			if = {
				limit = {
					ROOT = {
						original_tag = USA
						has_government = centrism
						has_cosmetic_tag = USA_free_states_of_america
					}
					FROM = {
						original_tag = USA
						has_government = autocracy
					}
				}
				every_state = {
					remove_core_of = ROOT
				}
				drop_cosmetic_tag = yes
				USA = {
		            annex_country = {
		                target = ROOT
		                transfer_troops = yes
		            }
		            add_ideas = {
	                    #hos_is_leader
	                    victorian_era
	                    doctrine_victorian_army_1
	                    industrializing
	                    #non_monarchical_system
	                    #presidential_republic

	                    civilian_economy
	                    export_focus
	                    army_spending_level_2
	                    taxation_level_3
	                    cl_restricted
	                    #twelve_hour_work_day

	                    #stagnation_growth
	                    border_control
	                    volunteer_only
	                    racial_laws
	                    universal_male_suffrage

	                    #constitution_adopted
	                    free_elections

	                    privileged_education
	                    state_religion
	                    #religion_protestant
	                }
		            set_politics = {
		                ruling_party = ideology_social_liberalism
		            }
		            create_country_leader = {
	                    name = "Ulysses S. Grant"
	                    desc = "POLITICS_FRANKLIN_DELANO_ROOSEVELT_DESC"
	                    picture = "Portrait_USA_Ulysses_grant.dds"
	                    expire = "1947.1.1"
	                    ideology = radical_liberal
	                }
		            add_ideas = {
	                    #hos_is_leader
	                    victorian_era
	                    doctrine_victorian_army_1
	                    industrializing
	                    #non_monarchical_system
	                    #presidential_republic

	                    civilian_economy
	                    export_focus
	                    army_spending_level_2
	                    taxation_level_3
	                    cl_restricted
	                    #twelve_hour_work_day

	                    #stagnation_growth
	                    border_control
	                    volunteer_only
	                    racial_laws
	                    universal_male_suffrage

	                    #constitution_adopted
	                    free_elections

	                    privileged_education
	                    secular_state
	                    #religion_protestant
	                }
		            add_popularity = {
		                ideology = centrism
		                popularity = 0.6
		            }
		            add_popularity = {
		                ideology = traditional_conservatism
		                popularity = 0.4
		            }
		        }
			}
			if = {
				limit = {
					original_tag = TEX
					has_government = traditional_conservatism
					TEX = { has_country_flag = TEX_civil_war }
				}
				TEX = { clr_country_flag = TEX_civil_war }
				ROOT = { drop_cosmetic_tag = yes }
				TEX = { drop_cosmetic_tag = yes }
				TEX = { remove_ideas = houston_revolt }
				ROOT = { country_event = { id = acw.62 } }
				every_owned_state = {
					remove_core_of = TEX
				}
				add_popularity = {
					ideology = centrism
					popularity = 0.17
				}
			}
			if = {
				limit = {
					original_tag = TEX
					has_government = centrism
					TEX = { has_country_flag = TEX_civil_war }
				}
				TEX = { clr_country_flag = TEX_civil_war }
				ROOT = { drop_cosmetic_tag = yes }
				event_target:TEX_CIVWAR_CSA_target = { drop_cosmetic_tag = yes }
				TEX = { remove_ideas = houston_revolt }
				ROOT = { country_event = { id = acw.61 } }
				every_owned_state = {
					remove_core_of = event_target:TEX_CIVWAR_CSA_target
				}
				add_popularity = {
					ideology = traditional_conservatism
					popularity = 0.12
				}
				add_popularity = {
					ideology = radical_democracy
					popularity = 0.12
				}
			}
		}
	}

	#used when puppeting in a peace conference
	#ROOT = nation being puppeted, FROM = overlord

	#on_puppet = {
	#	effect = {
	#
	#	}
	#}

	#used when puppeting through the occupied territories menu during peace time (or when releasing from non-core but owned territory, f.e. Britain releasing Egypt)
	#ROOT = nation being released, FROM = overlord

	on_release_as_puppet = {
		effect = {
			compute_national_vote = yes
		}
	}

	#ROOT is winner #FROM gets annexed - For civil wars on_civil_war_end is also fired
	#on_annex = {
	#	effect = {
	#
	#	}
	#}

	#on_unit_leader_created = {
	#	effect = {
	#	}
	#}


	#on_unit_leader_level_up = {
	#	effect = {
	#
	#	}
	#}

	# From is owner country
	#on_army_leader_daily = {
	#	effect = {
	#
	#	}
	#}

	# From is owner country
	#on_army_leader_won_combat = {
	#	effect = {
	#
	#	}
	#}

	# From is owner country
	#on_army_leader_lost_combat = {
	#	effect = {
	#
	#	}
	#}

	#on_army_leader_promoted = {
	#	effect = {
	#
	#	}
	#}
	
	#On state control change triggers whenever a province exchanges hands. Very laggy!
	#on_state_control_changed = { 
	#	effect = {
	#		if = {
	#			limit = {
	#				has_global_flag = eoanb_flag_franco_prussian_war_ongoing
	#				tag = FRA
	#				FROM.FROM = {
	#					is_owned_by = PRS
	#				}
	#			}
	#			country_event = fraprswar.32
	#		}
	#		if = {
	#			limit = {
	#				FROM.FROM = {
	#					state = 18
	#				}
	#				OR = {
	#					tag = PRS
	#					tag = BAD
	#					tag = WUR
	#					tag = BAV
	#				}
	#			}
	#			FRA = {
	#				country_event = nap_france.397
	#			}
	#		}
	#	}
	#}
	
	on_war = {
		effect = {
			if = {
				limit = {
					tag = DEN
					DEN = { has_country_flag = DEN_wartime_battalion_duplication_flag }
				}
				DEN = { add_ideas = DEN_idea_wartime_battalion_duplication }
			}
		}
	}

	# I can only guess this is Luxembourg Crisis stuff
	on_annex = { 
		effect = {
			if = {
				limit = { 
					FROM = { tag = LUX }
					ROOT = { tag = FRA }
				}
				FRA = { country_event = { id = nap_france.320 } }
			}
		}
	}
	on_puppet = { 
		effect = {
			if = {
				limit = { 
					FROM = { tag = LUX }
					ROOT = { tag = FRA }
				}
				FRA = { country_event = { id = nap_france.320 } }
			}
		}
	}
}
