﻿add_namespace = usarevolt
add_namespace = news_usarevolt

country_event = {
	id = usarevolt.1 #california
	title = usarevolt.1.t
	desc = usarevolt.1.d
	
	trigger = {
		AND = {
			tag = USA
			OR = {
				reactionary > 0.65
				monarchist > 0.65
				fascist > 0.65
				islamist > 0.65
				
				has_government = reactionary
				has_government = monarchist
				has_government = islamist
				has_government = fascist
				
				has_elections = no
				has_national_unity < 0.3
				
			}
			NOT = { has_completed_focus = USA_centralize_the_country }
			
			has_country_flag = CALrevoltready
			
			USA = { controls_state = 378 }
		}
	}
	
	mean_time_to_happen = {
		days = 175
	}
	
	immediate = {
		clr_country_flag = CALrevoltready
	}
	option = { #Grant them FULL autonomy
		name = usarevolt.1.o1
		
		release = CAL
		
		add_national_unity = 0.15
		
		add_political_power = 100
		
		CAL = {
			load_oob = CAL_releasepeaceful
		}
		
		ai_chance = {
			factor = 20
		}
	}
	
	option = { #Grant them PARTIAL autonomy
		name = usarevolt.1.o2
		
		add_national_unity = -0.5
		
		release = CAL
		
		CAL = {
			country_event = usarevolt.2
		}
		
		ai_chance = {
			factor = 40
		}
	}
	
	option = { #CRUSH THE REVOLT
		name = usarevolt.1.o3
		
		release = CAL
		
		add_national_unity = -0.15
		
		declare_war_on = {
			target = CAL type = annex_everything
		}
		
		add_political_power = -100
		
		set_country_flag = CALwar
		
		CAL = {
			load_oob = CAL_releasewar
		}
		
		378 = {
			add_core_of = USA
		}	
		
		ai_chance = {
			factor = 40
		}
	}
}

country_event = {
	id = usarevolt.2 #California become puppet pls
	title = usarevolt.2.t
	desc = usarevolt.2.d
	
	is_triggered_only = yes
	
	option = { #Sure
		name = usarevolt.2.o1
		
		USA = {
			puppet = CAL
		}
		
		CAL = {
			load_oob = CAL_releasepeaceful
		}
		
		ai_chance = {
			factor = 50
		}
	}
	
	option = { #NO!
		name = usarevolt.2.o2
		
		CAL = {
			load_oob = CAL_releasewar
		}
		
		USA = {
			declare_war_on = { target = CAL type = annex_everything } 
			
			set_country_flag = CALwar
		}
		
		ai_chance = {
			factor = 50
		}
	}
}

country_event = {
	id = usarevolt.3 #Cali whitepeace?
	title = usarevolt.3.t
	desc = usarevolt.3.d
	
	trigger = {
		tag = USA
		
		has_offensive_war_with = CAL
		
		has_country_flag = CALwar
	}
	
	mean_time_to_happen = {
		days = 100
	}
	
	immediate = {
		clr_country_flag = CALwar
	}
	
	option = { #Lets make peace
		name = usarevolt.3.o1
		
		every_country = {
			limit = {
				tag = USA
				is_in_faction_with = USA
				is_puppet_of = USA
			}
			
			white_peace = CAL
		}
		
		add_national_unity = 0.1
		
		378 = {
			remove_core_of = USA
		}
		
		ai_chance = {
			factor = 70
		}
	}
	
	option = { #THE WAR CONTINUES!
		name = usarevolt.3.o2

		
		add_national_unity = -0.2
		
		set_country_flag = CALwarbuffer
		
		ai_chance = {
			factor = 30
		}

	}
}

country_event = {
	id = usarevolt.4 #Event to keep asking for whitepeace if usa denies
	title = usarevolt.4.t
	desc = usarevolt.4.d
	
	hidden = yes
	
	trigger = {
		tag = USA
		
		has_offensive_war_with = CAL
		
		has_country_flag = CALwarbuffer
	}
	
	mean_time_to_happen = {
		days = 75
	}
	
	
	option = { 
		name = usarevolt.4.o1
		
		clr_country_flag = CALwarbuffer
	}
	
}

country_event = {
	id = usarevolt.10 #Event to start a cooldown of the revolt
	title = usarevolt.10.t
	desc = usarevolt.10.d
	
	hidden = yes
	
	trigger = {
		tag = USA
		
		NOT = { has_country_flag = CALrevoltready }
	}
	
	mean_time_to_happen = {
		days = 500
	}
	
	
	option = { #
		name = usarevolt.10.o1
		
		set_country_flag = CALrevoltready
	}
	
}




country_event = {
	id = usarevolt.5 #texas
	title = usarevolt.5.t
	desc = usarevolt.5.d
	
	trigger = {
		AND = {
			tag = USA
			OR = {
				monarchist > 0.65
				fascist > 0.65
				islamist > 0.65
				communist > 0.65
				democratic_socialist > 0.65
				
				has_government = communist
				has_government = monarchist
				has_government = islamist
				has_government = fascist
				has_government = democratic_socialist
				
				has_elections = no
				has_national_unity < 0.3
				
				
			}
			NOT = { has_completed_focus = USA_centralize_the_country }
			has_country_flag = TEXrevoltready
			USA = { controls_state = 375 }
		}
	}
	
	mean_time_to_happen = {
		days = 125
	}
	
	immediate = {
		clr_country_flag = TEXrevoltready
	}
	option = { #Grant them FULL autonomy
		name = usarevolt.5.o1
		
		release = TEX
		
		add_national_unity = 0.15
		
		add_political_power = 100
		
		TEX = {
			load_oob = TEX_releasepeaceful
		}
		
		ai_chance = {
			factor = 20
		}
	}
	
	option = { #Grant them PARTIAL autonomy
		name = usarevolt.5.o2
		
		add_national_unity = -0.5
		
		release = TEX
		
		TEX = {
			country_event = usarevolt.6
		}
		
		ai_chance = {
			factor = 40
		}
	}
	
	option = { #CRUSH THE REVOLT
		name = usarevolt.5.o3
		
		release = TEX
		
		add_national_unity = -0.15
		
		declare_war_on = {
			target = TEX type = annex_everything
		}
		
		add_political_power = -100
		
		375 = {
			add_core_of = USA
		}
		set_country_flag = TEXwar
		
		TEX = {
			load_oob = TEX_releasewar
		}
		
		ai_chance = {
			factor = 40
		}
	}
}

country_event = {
	id = usarevolt.6 #Texas become puppet pls
	title = usarevolt.6.t
	desc = usarevolt.6.d
	
	is_triggered_only = yes
	
	option = { #Sure
		name = usarevolt.6.o1
		
		USA = {
			puppet = TEX
		}
		
		TEX = {
			load_oob = TEX_releasepeaceful
		}
		
		ai_chance = {
			factor = 50
		}
	}
	
	option = { #NO!
		name = usarevolt.6.o2
		
		TEX = {
			load_oob = TEX_releasewar
		}
		
		USA = {
			declare_war_on = { target = TEX type = annex_everything } 
			
			set_country_flag = TEXwar
		}
		
		ai_chance = {
			factor = 50
		}
	}
}

country_event = {
	id = usarevolt.7 #Tex whitepeace?
	title = usarevolt.7.t
	desc = usarevolt.7.d
	
	trigger = {
		tag = USA
		
		has_offensive_war_with = TEX
		
		has_country_flag = TEXwar
	}
	
	mean_time_to_happen = {
		days = 100
	}
	
	immediate = {
		clr_country_flag = TEXwar
	}
	
	
	option = { #Lets make peace
		name = usarevolt.7.o1
		
		
		every_country = {
			limit = {
				tag = USA
				is_in_faction_with = USA
				is_puppet_of = USA
			}
			
			white_peace = TEX
		}
		
		
		add_national_unity = 0.1
		
		375 = {
			remove_core_of = USA
		}
		
		ai_chance = {
			factor = 50
		}
	}
	
	option = { #THE WAR CONTINUES!
		name = usarevolt.7.o1
		
		
		add_national_unity = -0.2
		
		set_country_flag = TEXwarbuffer
		
		ai_chance = {
			factor = 50
		}

	}
}

country_event = {
	id = usarevolt.8 #Event to keep asking for whitepeace if usa denies
	title = usarevolt.8.t
	desc = usarevolt.8.d
	
	hidden = yes
	
	trigger = {
		tag = USA
		
		has_offensive_war_with = TEX
		
		has_country_flag = TEXwarbuffer
	}
	
	mean_time_to_happen = {
		days = 50
	}
	
	
	option = { #Lets make peace
		name = usarevolt.4.o1
		
		set_country_flag = TEXwar
		clr_country_flag = TEXwarbuffer
	}
	
}

country_event = {
	id = usarevolt.9 #Event to start a cooldown of the revolt
	title = usarevolt.9.t
	desc = usarevolt.9.d
	
	hidden = yes
	
	trigger = {
		tag = USA
		
		NOT = { has_country_flag = TEXrevoltready }
	}
	
	mean_time_to_happen = {
		days = 500
	}
	
	
	option = {
		name = usarevolt.9.o1
		
		set_country_flag = TEXrevoltready
	}
	
}