﻿namespace = revolution_pulse1_events

# Membership Lists Discovered
revolution_pulse1_events.1 = {
	type = country_event
	event_image = {
		video = "africa_leader_arguing"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.1.t
	desc = revolution_pulse1_events.1.d
	flavor = revolution_pulse1_events.1.f

	category = revolution

	duration = 3

	trigger = {
		revolution_progress_low = yes
		NOT = { has_law = law_type:law_no_police }
		any_revolution_ongoing = yes
		any_interest_group = {
			is_insurrectionary = yes
		}
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		random_interest_group = {
			limit = {
				is_insurrectionary = yes
			}
			save_scope_as = membership_list_ig
			if = {
				limit = {
					any_scope_character = {
						has_role = agitator
					}
				}
				random_scope_character = {
					limit = {
						has_role = agitator
					}
					save_scope_as = membership_list_agitator
				}
			}
		}
	}

	option = { # Hunt down the members!
		name = revolution_pulse1_events.1.a
		default_option = yes

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_retreat_medium
		}
	}

	option = { # Expose the connection between the [IG] and these revolutionaries!
		name = revolution_pulse1_events.1.b

		scope:membership_list_ig = {
			add_modifier = {
				name = membership_arrested
				days = short_modifier_time
			}
		}
	}

	option = { # There's only one name on this list we need: [Agitator]
		name = revolution_pulse1_events.1.c

		trigger = {
			scope:membership_list_ig = {
				any_scope_character = {
					has_role = agitator
				}
			}
		}

		if = {
			limit = {
				scope:membership_list_ig = {
					any_scope_character = {
						has_role = agitator
					}
				}
			}
			random_list = {
				1 = {
					scope:membership_list_agitator = {
						add_modifier = {
							name = on_the_run
							days = short_modifier_time
						}
					}
				}
				1 = {
					scope:membership_list_agitator = {
						add_modifier = {
							name = cleared_of_charges
							days = short_modifier_time
						}
					}
				}
			}
		}
	}
}

# Anger at the Front
revolution_pulse1_events.2 = {
	type = country_event
	event_image = {
		video = "middleeast_battlefield_trenches"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.2.t
	desc = revolution_pulse1_events.2.d
	flavor = revolution_pulse1_events.2.f

	category = revolution

	duration = 3

	trigger = {
		any_scope_war = {
		    has_war_support = {
		        target = ROOT
		        value < 10
		    }
		}
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
	}

	cancellation_trigger = {
		NOR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_war = {
			limit = {
			    has_war_support = {
			        target = ROOT
			        value < 10
			    }
		    }
		    save_scope_as = anger_at_front_war
		}
	}

	option = { # Arrest the grumblers and fight on.
		name = revolution_pulse1_events.2.a
		default_option = yes

		random_list = {
			1 = {
				scope:anger_at_front_war = {
					add_war_exhaustion = {
						target = ROOT
						value = 10
					}
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
			1 = {
				add_modifier = {
					name = collapsing_army_morale
					days = short_modifier_time
				}
			}
		}
	}

	option = { # We cannot afford to detain any soldiers.
		name = revolution_pulse1_events.2.b

		# Get exhaustion no matter what
		scope:anger_at_front_war = {
			add_war_exhaustion = {
				target = ROOT
				value = 10
			}
		}

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}
			}
			1 = {
				add_modifier = {
					name = collapsing_army_morale
					days = short_modifier_time
				}
			}
		}
	}

	option = { # We must stop and let the men rest.
		name = revolution_pulse1_events.2.c

		add_radicals = {
			pop_type = officers
			value = small_radicals
		}

		add_modifier = {
			name = recovering_army_morale
			days = short_modifier_time
		}

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_retreat_medium
		}
	}
}

# Publishing Committee Prosecutions
revolution_pulse1_events.3 = {
	type = country_event
	event_image = {
		video = "votp_prison"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.3.t
	desc = revolution_pulse1_events.3.d
	flavor = revolution_pulse1_events.3.f

	category = revolution

	duration = 3

	trigger = {
		revolution_progress_low = yes
		any_revolution_ongoing = yes
		any_interest_group = {
			is_insurrectionary = yes
		}
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		random_interest_group = {
			limit = {
				is_insurrectionary = yes
			}
			save_scope_as = publishing_committee_ig
		}
	}

	option = {
		name = revolution_pulse1_events.3.a
		default_option = yes

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_retreat_small
		}

		scope:publishing_committee_ig = {
			add_modifier = {
				name = publicized_court_proceedings
				days = short_modifier_time
			}
		}
	}

	option = { # Quietly muzzle them
		name = revolution_pulse1_events.3.b
		trigger = {
			NOT = { has_law = law_type:law_protected_speech }
		}


		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_retreat_medium
		}

		scope:publishing_committee_ig = {
			add_modifier = {
				name = muzzled_activists
				days = short_modifier_time
			}
		}
	}

	option = { # Let them publicize what they want
		name = revolution_pulse1_events.3.c

		random_list = {
            1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
            }
            1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}
            }
            1 = {
            	scope:publishing_committee_ig = {
					add_modifier = {
						name = poorly_worded_pamphlets
						days = normal_modifier_time
					}
				}
            }
    	}
    }
}

# The Infernal Machine
revolution_pulse1_events.4 = {
	type = country_event
	event_image = {
		video = "unspecific_ruler_speaking_to_people"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.4.t
	desc = revolution_pulse1_events.4.d
	flavor = revolution_pulse1_events.4.f

	category = revolution

	duration = 3

	trigger = {
		revolution_progress_medium = yes
		any_revolution_ongoing = yes

		any_scope_character = {
			has_role = agitator
		}
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		ruler = {
			save_scope_as = infernal_machine_ruler
		}
		random_scope_character = {
			limit = {
				has_role = agitator
			}
			save_scope_as = infernal_agitator
		}
	}

	option = { # Limit public appearances by the ruler
		name = revolution_pulse1_events.4.a
		default_option = yes

		scope:infernal_machine_ruler = {
			add_modifier = {
				name = withdrawn_from_the_public
				days = normal_modifier_time
			}
		}
	}


	option = { # Try to pin this on an agitator
		name = revolution_pulse1_events.4.b

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
			1 = {
				scope:infernal_agitator = {
					add_modifier = {
						name = on_the_run
						days = short_modifier_time
					}
				}
			}
			1 = {
				scope:infernal_agitator = {
					add_modifier = {
						name = cleared_of_charges
						days = short_modifier_time
					}
				}

				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}
			}
		}
	}
}

# Ersatz Food
revolution_pulse1_events.5 = {
	type = country_event
	event_image = {
		video = "votp_realist_household"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.5.t
	desc = revolution_pulse1_events.5.d
	flavor = revolution_pulse1_events.5.f

	category = revolution

	duration = 3

	trigger = {
		any_scope_state = {
			average_sol < 7 # Struggling
			is_incorporated = yes
		}
		any_revolution_ongoing = yes
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_state = {
			limit = {
				average_sol < 7
				is_incorporated = yes
			}
			save_scope_as = food_substitution_state
		}
	}

	option = {
		name = revolution_pulse1_events.5.a
		default_option = yes

		scope:food_substitution_state = {
			add_modifier = {
				name = risky_food_substitutes
				days = normal_modifier_time
			}
		}
	}


	option = {
		name = revolution_pulse1_events.5.b

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_retreat_medium
		}

		scope:food_substitution_state = {
			add_modifier = {
				name = farming_incentives
				days = normal_modifier_time
			}
		}
	}


	option = {
		name = revolution_pulse1_events.5.c

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_advance_medium
		}

		scope:food_substitution_state = {
			add_modifier = {
				name = collapsing_agricultural_sector
				days = normal_modifier_time
			}
		}
	}
}

# The Sacred Union
revolution_pulse1_events.6 = {
	type = country_event
	event_image = {
		video = "southamerica_election"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/waving_flag.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.6.t
	desc = revolution_pulse1_events.6.d
	flavor = revolution_pulse1_events.6.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			revolution_progress_low = yes
			secession_progress_low = yes
		}
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		is_at_war = yes
	}

	cancellation_trigger = {
		NOR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
	}

	immediate = {
		save_revolution_scopes = yes
	}

	option = {
		name = revolution_pulse1_events.6.a
		default_option = yes

		add_modifier = {
			name = sacred_union_approval
			days = short_modifier_time
		}

		every_interest_group = {
			limit = {
				is_in_government = no
			}

			add_modifier = {
				name = sacred_union_strength
				days = short_modifier_time
			}
		}
	}


	option = {
		name = revolution_pulse1_events.6.b

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_advance_medium
		}

		every_interest_group = {
			limit = {
				is_in_government = no
			}

			add_modifier = {
				name = marginalized_by_war
				days = short_modifier_time
			}
		}
	}
}

# The Waffling Revolutionary
revolution_pulse1_events.7 = {
	type = country_event
	event_image = {
		video = "votp_conspiring"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.7.t
	desc = revolution_pulse1_events.7.d
	flavor = revolution_pulse1_events.7.f

	category = revolution

	duration = 3

	trigger = {
		any_revolution_ongoing = yes
		any_scope_character = {
			OR = {
				has_role = general
				has_role = admiral
			}
			interest_group = {
				is_insurrectionary = yes
			}
			is_busy = no
			is_immortal = no
		}
		any_interest_group = {
			is_insurrectionary = yes
		}
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_character = {
			limit = {
				OR = {
					has_role = general
					has_role = admiral
				}
				interest_group = {
					is_insurrectionary = yes
				}
				is_busy = no
			}
			save_scope_as = guglielmo_pepe
			interest_group = {
				save_scope_as = guglielmo_pepe_ig
			}
		}
		random_interest_group = {
			limit = {
				is_insurrectionary = no
			}
			save_scope_as = potential_loyal_interest_group
		}
	}

	option = {
		name = revolution_pulse1_events.7.a
		default_option = yes

		random_list = {
			1 = {
				scope:guglielmo_pepe_ig = {
					add_modifier = {
						name = fence_sitter_encourages_reconciliation
						days = short_modifier_time
					}
				}

				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
			1 = {
				scope:guglielmo_pepe_ig = {
					add_modifier = {
						name = fence_sitter_sides_with_revolutionaries
						days = short_modifier_time
					}
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.7.b
		trigger = {
			NOT = { has_law = law_type:law_secret_police }
		}

		random_list = {
			1 = {
				scope:guglielmo_pepe = {
					kill_character = yes
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}

				scope:guglielmo_pepe = {
					add_modifier = {
						name = on_the_run
						days = short_modifier_time
					}
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.7.b
		trigger = {
			has_law = law_type:law_secret_police
		}

		random_list = {
			2 = {
				scope:guglielmo_pepe = {
					kill_character = yes
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}

				scope:guglielmo_pepe = {
					add_modifier = {
						name = on_the_run
						days = short_modifier_time
					}
				}
			}
		}
	}
}

# Sailors Stay Ashore
revolution_pulse1_events.8 = {
	type = country_event
	placement = scope:coastal_navy_state
	event_image = {
		video = "votp_gunboat_diplomacy"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.8.t
	desc = revolution_pulse1_events.8.d
	flavor = revolution_pulse1_events.8.f

	category = revolution

	duration = 3

	trigger = {
		any_revolution_ongoing = yes
		is_at_war = yes
		any_scope_state = {
			is_coastal = yes
			is_incorporated = yes
		}
		any_interest_group = {
			is_insurrectionary = yes
		}
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_state = {
			limit = {
				is_coastal = yes
				is_incorporated = yes
			}
			save_scope_as = coastal_navy_state
		}
	}

	option = { # Detain the men at port
		name = revolution_pulse1_events.8.a
		default_option = yes

		scope:coastal_navy_state = {
			add_loyalists_in_state = {
				pop_type = officers
				value = medium_radicals
			}
			add_radicals_in_state = {
				pop_type = soldiers
				value = very_large_radicals
			}
		}
	}

	option = { # Force the men onto the ships
		name = revolution_pulse1_events.8.b

		add_radicals = {
			pop_type = soldiers
			value = medium_radicals
		}
	}

	option = { # Let the men stay at port in peace
		name = revolution_pulse1_events.8.c

		add_radicals = {
			pop_type = officers
			value = medium_radicals
		}
	}
}

# Endangered Gold Reserves
revolution_pulse1_events.9 = {
	type = country_event
	event_image = {
		video = "europenorthamerica_springtime_of_nations"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.9.t
	desc = revolution_pulse1_events.9.d
	flavor = revolution_pulse1_events.9.f

	category = revolution

	duration = 3

	trigger = {
		any_revolution_ongoing = yes
		capital = {
			radical_fraction = {
				value > 0.33
			}
		}
		any_scope_state = {
			radical_fraction = {
				value <= 0.33
			}
			is_incorporated = yes
		}
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		capital = {
			save_scope_as = radical_capital
		}
		random_scope_state = {
			limit = {
				radical_fraction = {
					value <= 0.33
				}
				is_incorporated = yes
			}
			save_scope_as = loyalist_province
		}
	}

	option = { # Take the gold reserves out of the capital
		name = revolution_pulse1_events.9.a
		default_option = yes

		random_list = {
			2 = {
				add_modifier = {
					name = secured_gold_reserves
					days = normal_modifier_time
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}

				add_modifier = {
					name = lost_gold_reserves
					days = normal_modifier_time
				}
			}
		}
	}

	option = { # Leave the reserves where they are
		name = revolution_pulse1_events.9.b

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}

				add_modifier = {
					name = untouched_gold
					days = normal_modifier_time
				}
			}
			2 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}

				add_modifier = {
					name = lost_gold_reserves
					days = normal_modifier_time
				}
			}
		}
	}
}

# Fleeing the Capital
revolution_pulse1_events.10 = {
	type = country_event
	event_image = {
		video = "votp_barricade"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.10.t
	desc = revolution_pulse1_events.10.d
	flavor = revolution_pulse1_events.10.f

	category = revolution

	duration = 3

	trigger = {
		revolution_progress_high = yes
		any_revolution_ongoing = yes
		capital = {
			radical_fraction = {
				value > 0.33
			}
		}
		any_scope_state = {
			radical_fraction = {
				value <= 0.33
			}
			is_incorporated = yes
		}
	}

	cancellation_trigger = {
		NOT = { any_revolution_ongoing = yes }
	}

	immediate = {
		save_revolution_scopes = yes
		capital = {
			save_scope_as = potential_revolutionary_capital
		}
		random_scope_state = {
			limit = {
				radical_fraction = {
					value <= 0.33
				}
				is_incorporated = yes
			}
			save_scope_as = potential_loyalist_capital
		}
	}

	option = {
		name = revolution_pulse1_events.10.a
		default_option = yes

		add_modifier = {
			name = moving_government_functions
			days = short_modifier_time
		}

		scope:potential_loyalist_capital = {
			add_loyalists_in_state = {
				value = medium_radicals
			}
		}

		random_list = {
			2 = {
				add_modifier = {
					name = secure_government
					days = short_modifier_time
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}

				add_modifier = {
					name = abandoned_capital
					days = short_modifier_time
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.10.b

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}

				scope:potential_revolutionary_capital = {
					add_loyalists_in_state = {
						value = medium_radicals
					}
				}
			}
			2 = {
				add_modifier = {
					name = revolutionaries_at_the_gates
					days = short_modifier_time
				}
			}
		}
	}
}

# The Rebel's Doctor
revolution_pulse1_events.11 = {
	type = country_event
	event_image = {
		video = "votp_prison"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_default.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.11.t
	desc = revolution_pulse1_events.11.d
	flavor = revolution_pulse1_events.11.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			revolution_progress_low = yes
			secession_progress_low = yes
			revolution_progress_medium = yes
			secession_progress_medium = yes
		}
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		any_scope_state = {
			any_scope_pop = {
				is_pop_type = academics
			}
			is_in_revolt = yes
			is_incorporated = yes
		}
	}

	cancellation_trigger = {
		NOR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_state = {
			limit = {
				any_scope_pop = {
					is_pop_type = academics
				}
				is_in_revolt = yes
				is_incorporated = yes
			}
			save_scope_as = rebel_doctors_state
		}
	}


	option = {
		name = revolution_pulse1_events.11.a
		default_option = yes

		if = {
			limit = {
				NOT = { has_law = law_type:law_no_police }
			}
			scope:ongoing_revolution = {
				add_civil_war_progress = revolution_retreat_small
			}
		}
		else = {
			scope:ongoing_revolution = {
				add_civil_war_progress = revolution_advance_small
			}
		}

		scope:rebel_doctors_state = {
			add_radicals_in_state = {
				pop_type = academics
				value = very_large_radicals
			}
		}
	}

	option = {
		name = revolution_pulse1_events.11.b

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_retreat_small
		}

		add_radicals = {
			pop_type = academics
			value = small_radicals
		}
	}
}

# Revolutionary in subject state
revolution_pulse1_events.12 = {
	type = country_event
	event_image = {
		video = "europenorthamerica_springtime_of_nations"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.12.t
	desc = revolution_pulse1_events.12.d
	flavor = revolution_pulse1_events.12.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		any_country = {
			is_direct_subject_of = ROOT # not bothering with sub-vassals
			any_scope_character = {
				has_role = agitator
				home_country = ROOT
				is_immortal = no
			}
		}
	}

	cancellation_trigger = {
		OR = {
			NOR = {
				any_revolution_ongoing = yes
				any_secession_ongoing = yes
			}
			NOT = {
				scope:safehaven_for_dissidents = {
					is_direct_subject_of = ROOT
				}
			}
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_country = {
			limit = {
				is_direct_subject_of = ROOT
				any_scope_character = {
					has_role = agitator
					home_country = ROOT
					is_immortal = no
				}
			}
			random_scope_character = {
				limit = {
					has_role = agitator
					home_country = ROOT
					is_immortal = no
				}
				save_scope_as = safehaven_dissident
			}
			save_scope_as = safehaven_for_dissidents
		}
	}


	option = {
		name = revolution_pulse1_events.12.a
		default_option = yes

		scope:safehaven_for_dissidents = {
			trigger_event = { id = revolution_pulse1_events.13 days = 3 }
		}

		ai_chance = {
			base = 3

			modifier = {
				trigger = {
					ruler = {
						OR = {
							has_trait = basic_diplomat
							has_trait = experienced_diplomat
							has_trait = masterful_diplomat
							has_trait = basic_political_operator
							has_trait = experienced_political_operator
							has_trait = expert_political_operator
						}
					}
				}
				add = 10
			}
		}
	}

	option = {
		name = revolution_pulse1_events.12.b

		# Subject is not happy they were raided by overlord, even if the raid is a failure
		scope:safehaven_for_dissidents = {
			change_relations = {
				country = ROOT
				value = -20
			}
		}

		random_list = {
			1 = {
				scope:safehaven_dissident = {
					kill_character = yes
				}
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
			1 = {
				scope:safehaven_for_dissidents = {
					trigger_event = { id = revolution_pulse1_events.14 days = 3 }
				}
			}
		}

		ai_chance = {
			base = 1

			modifier = {
				trigger = {
					ruler = {
						has_trait = reckless
					}
				}
				add = 10
			}
		}
	}

	option = {
		name = revolution_pulse1_events.12.c

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_advance_small
		}
	}
}

# Parent country demands agitator
revolution_pulse1_events.13 = {
	type = country_event
	event_image = {
		video = "votp_hostile_court"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_military.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.13.t
	desc = revolution_pulse1_events.13.d
	flavor = revolution_pulse1_events.13.f

	duration = 3

	# Triggered by revolution_pulse1_events.12

	immediate = {
		overlord = {
			save_revolution_scopes = yes
			save_scope_as = parent_of_safehaven
		}
	}

	cancellation_trigger = {
		OR = {
			scope:parent_of_safehaven = {
				NOR = {
					any_revolution_ongoing = yes
					any_secession_ongoing = yes
				}
			}
			scope:safehaven_dissident = {
				is_character_alive = no
			}
		}
	}

	option = {
		name = revolution_pulse1_events.13.a
		default_option = yes

		custom_tooltip = {
			text = revolution_pulse1_events.13.a.tt
		}
		hidden_effect = {
			scope:safehaven_dissident = {
				kill_character = yes
			}
		}
		custom_tooltip = {
			text = revolution_pulse1_events.13.a.tt2
		}
		hidden_effect = {
			scope:ongoing_revolution = {
				add_civil_war_progress = revolution_retreat_medium
			}
		}
		scope:parent_of_safehaven = {
			change_relations = {
				country = ROOT
				value = 20
			}
			post_notification = revolution_pulse1_events13agitator_killed
		}

		ai_chance = {
			base = 1
			modifier = {
				trigger = {
					scope:parent_of_safehaven = { # Parent country is very good at asking nicely
						ruler = {
							OR = {
								has_trait = basic_diplomat
								has_trait = experienced_diplomat
								has_trait = masterful_diplomat
								has_trait = basic_political_operator
								has_trait = experienced_political_operator
								has_trait = expert_political_operator
							}
						}
					}
				}
				add = 10
			}
		}
	}


	option = {
		name = revolution_pulse1_events.13.b

		scope:parent_of_safehaven = { # Mama ain't happy...
			change_relations = {
				country = ROOT
				value = -50
			}
			post_notification = revolution_pulse1_events13agitator_not_killed
		}

		ai_chance = {
			base = 1
			modifier = {
				trigger = {
					ruler = {
						OR = {
							has_trait = bandit
							has_trait = social_bandit
						}
					}
				}
				add = 10 # no snitches
			}
		}
	}
}

# Parent country tried some illegal extradition
revolution_pulse1_events.14 = {
	type = country_event
	event_image = {
		video = "votp_agitators_sneaking"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.14.t
	desc = revolution_pulse1_events.14.d
	flavor = revolution_pulse1_events.14.f

	duration = 3

	# Triggered by revolution_pulse1_events.12

	immediate = {
		overlord = {
			save_scope_as = parent_of_safehaven
		}
	}

	cancellation_trigger = {
		OR = {
			scope:parent_of_safehaven = {
				NOR = {
					any_revolution_ongoing = yes
					any_secession_ongoing = yes
				}
			}
			scope:safehaven_dissident = {
				is_character_alive = no
			}
		}
	}

	option = {
		name = revolution_pulse1_events.14.a

		custom_tooltip = {
			text = revolution_pulse1_events.13.a.tt
		}
		hidden_effect = {
			scope:safehaven_dissident = {
				kill_character = yes
			}
		}
		custom_tooltip = {
			text = revolution_pulse1_events.13.a.tt2
		}

		scope:parent_of_safehaven = {
			hidden_effect = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
			change_relations = {
				country = ROOT
				value = 20
			}
			post_notification = revolution_pulse1_events14agitator_belatedly_killed
		}
	}

	option = {
		name = revolution_pulse1_events.14.b
		default_option = yes

		scope:parent_of_safehaven = {
			change_relations = {
				country = ROOT
				value = -50
			}
		}

		scope:parent_of_safehaven = {
			post_notification = revolution_pulse1_events14safehaven_very_angry
		}
	}
}

# Siege of the arsenal
revolution_pulse1_events.15 = {
	type = country_event
	placement = scope:besieged_arsenal

	event_image = {
		video = "votp_barricade"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.15.t
	desc = revolution_pulse1_events.15.d
	flavor = revolution_pulse1_events.15.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		any_scope_state = {
			is_in_revolt = yes
			any_scope_building = {
				is_building_type = building_barracks
			}
		}
	}

	cancellation_trigger = {
		NOR = {
			any_secession_ongoing = yes
			any_revolution_ongoing = yes
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_state = {
			limit = {
				is_in_revolt = yes
				any_scope_building = {
					is_building_type = building_barracks
				}
			}
			save_scope_as = besieged_arsenal
		}
	}

	option = {
		name = revolution_pulse1_events.15.a
		default_option = yes

		scope:besieged_arsenal = { # Soldiery hates the orders to hold out and suffer abuse
			add_radicals_in_state = {
				value = medium_radicals
				pop_type = soldiers
			}
		}

		random_list = {
			2 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.15.b

		scope:besieged_arsenal = { # Officers hate the dishonor of surrendering to the mob
			add_radicals_in_state = {
				value = medium_radicals
				pop_type = officers
			}
		}

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
			2 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
			}
		}
	}
}

# The Mob Approaches
revolution_pulse1_events.16 = {
	type = country_event
	placement = scope:radicalized_state
	event_image = {
		video = "europenorthamerica_springtime_of_nations"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_military.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.16.t
	desc = revolution_pulse1_events.16.d
	flavor = revolution_pulse1_events.16.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		any_scope_state = {
			is_in_revolt = yes
		}
	}

	cancellation_trigger = {
		NOR = {
			any_secession_ongoing = yes
			any_revolution_ongoing = yes
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_state = {
			limit = {
				is_in_revolt = yes
			}
			save_scope_as = radicalized_state
		}
	}

	option = {
		name = revolution_pulse1_events.16.a
		default_option = yes

		random_list = {
			1 = {
				scope:radicalized_state = {
					add_radicals_in_state = {
						value = medium_radicals
					}
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.16.b

		random_list = {
			1 = {
				scope:radicalized_state = {
					add_loyalists_in_state = {
						value = small_radicals
					}
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
			}
		}
	}
}

# The Procession of Provocations
revolution_pulse1_events.17 = {
	type = country_event
	placement = scope:provocative_procession_state
	event_image = {
		video = "europenorthamerica_sufferage"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_protest.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.17.t
	desc = revolution_pulse1_events.17.d
	flavor = revolution_pulse1_events.17.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		any_scope_state = {
			is_in_revolt = yes
			radical_fraction = {
				value > 0.25
				strata = lower
			}
		}
	}

	cancellation_trigger = {
		NOR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_state = {
			limit = {
				is_in_revolt = yes
				radical_fraction = {
					value > 0.25
					strata = lower
				}
			}
			save_scope_as = provocative_procession_state
		}
	}

	option = {
		name = revolution_pulse1_events.17.a
		default_option = yes

		random_list = {
			1 = {
				scope:provocative_procession_state = {
					add_radicals_in_state = {
						value = small_radicals
					}
				}
			}
			1 = {
				scope:provocative_procession_state = {
					add_radicals_in_state = {
						value = large_radicals
						strata = lower
					}
				}
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.17.b

		scope:provocative_procession_state = {
			add_radicals_in_state = {
				value = medium_radicals
				strata = lower
			}
		}

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.17.c
		trigger = {
			OR = {
				has_law = law_type:law_militarized_police
				scope:provocative_procession_state = {
					has_decree = decree_violent_suppression
				}
			}
		}
		highlighted_option = yes

		scope:provocative_procession_state = {
			add_modifier = {
				name = enforced_strict_curfew
				days = short_modifier_time
			}
		}

		random_list = {
			2 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_medium
				}
			}
		}
	}
}

# When You Have A Hammer
revolution_pulse1_events.18 = {
	type = country_event
	placement = scope:will_kill_for_peace_state
	event_image = {
		video = "europenorthamerica_before_the_battle"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_skull.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.18.t
	desc = revolution_pulse1_events.18.d
	flavor = revolution_pulse1_events.18.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		any_scope_character = {
			has_role = general
		}
		any_scope_state = {
			is_in_revolt = yes
		}
	}

	cancellation_trigger = {
		OR = {
			NOR = {
				any_revolution_ongoing = yes
				any_secession_ongoing = yes
			}
			scope:will_kill_for_peace_general = {
				is_character_alive = no
			}
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_character = {
			limit = {
				has_role = general
			}
			save_scope_as = will_kill_for_peace_general
		}
		random_scope_state = {
			limit = {
				is_in_revolt = yes
			}
			save_scope_as = will_kill_for_peace_state
		}
	}

	option = {
		name = revolution_pulse1_events.18.a
		default_option = yes

		scope:will_kill_for_peace_general = {
			if = {
				limit = {
					commander_rank > 1
				}
				add_commander_rank = -1
			}
			interest_group = {
				add_modifier = {
					name = our_general_is_disrespected
					days = normal_modifier_time
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.18.b

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
			2 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.18.c
		trigger = {
			scope:will_kill_for_peace_general = {
				has_trait = honorable
				NOR = {
					has_trait = pillager
					has_trait = bandit
					has_trait = wrathful
					has_trait = social_bandit
				}
			}
		}
		highlighted_option = yes

		scope:ongoing_revolution = {
			add_civil_war_progress = revolution_retreat_small
		}
	}

	option = {
		name = revolution_pulse1_events.18.dd
		trigger = {
			scope:will_kill_for_peace_general = {
				NOT = { has_trait = honorable }
				OR = {
					has_trait = pillager
					has_trait = bandit
					has_trait = wrathful
					has_trait = social_bandit
				}
			}
		}
		highlighted_option = yes

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}
			}
		}
	}
}

# Mob confronts the army
revolution_pulse1_events.19 = {
	type = country_event
	placement = scope:mob_gathering_state
	event_image = {
		video = "europenorthamerica_before_the_battle"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"

	icon = "gfx/interface/icons/event_icons/event_military.dds"

	cooldown = { days = very_long_modifier_time }

	title = revolution_pulse1_events.19.t
	desc = revolution_pulse1_events.19.d
	flavor = revolution_pulse1_events.19.f

	category = revolution

	duration = 3

	trigger = {
		OR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
		any_scope_state = {
			is_in_revolt = yes
		}
	}

	cancellation_trigger = {
		NOR = {
			any_revolution_ongoing = yes
			any_secession_ongoing = yes
		}
	}

	immediate = {
		save_revolution_scopes = yes
		random_scope_state = {
			limit = {
				is_in_revolt = yes
			}
			save_scope_as = mob_gathering_state
		}
	}

	option = {
		name = revolution_pulse1_events.19.a
		default_option = yes

		scope:mob_gathering_state = {
			add_modifier = {
				name = void_of_law
				days = short_modifier_time
			}
		}
		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
			}
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.19.b
		trigger = {
			OR = {
				has_law = law_type:law_peasant_levies
				has_law = law_type:law_mass_conscription
			}
		}
		highlighted_option = yes

		scope:mob_gathering_state = {
			add_modifier = {
				name = violent_confrontations
				days = short_modifier_time
			}
		}
		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_medium
				}
			}
			2 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
		}
		random_list = {
			1 = {
				add_modifier = {
					name = troop_loyalty_shaken
					days = short_modifier_time
				}
			}
			1 = {
				# this space blank
			}
		}
	}

	option = {
		name = revolution_pulse1_events.19.c
		trigger = {
			has_law = law_type:law_professional_army
		}
		highlighted_option = yes

		scope:mob_gathering_state = {
			add_modifier = {
				name = violent_confrontations
				days = short_modifier_time
				multiplier = 0.5
			}
		}

		random_list = {
			1 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
			}
			2 = {
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
		}
	}

	option = {
		name = revolution_pulse1_events.19.dd
		trigger = {
			has_law = law_type:law_national_militia
		}
		highlighted_option = yes

		random_list = {
			1 = {
				add_radicals = {
					pop_type = soldiers
					value = large_radicals
				}
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_advance_small
				}
			}
			2 = {
				scope:mob_gathering_state = {
					add_loyalists_in_state = {
						value = small_radicals
					}
				}
				scope:ongoing_revolution = {
					add_civil_war_progress = revolution_retreat_small
				}
			}
		}
	}
}
