namespace = peoples_springtime

# The Spark
# Country has a revolution including Radicals
peoples_springtime.1 = {
	type = country_event
	event_image = {
		video = "gfx/event_pictures/europenorthamerica_springtime_of_nations.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/springtime_of_nation"

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

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

	trigger = {
		NOT = { has_global_variable = peoples_springtime_happening }
		NOT = { has_global_variable = peoples_springtime_happened }
		country_is_in_europe = yes
		OR = {
			has_technology_researched = egalitarianism
			year >= 1849
		}
		any_interest_group = {
			ig_approval <= angry
			leader = { has_ideology = ideology_radical }
		}
	}

	immediate = {
		set_global_variable = {
			name = peoples_springtime_happening
		}
		set_global_variable = {
			name = peoples_springtime_recent
			months = normal_modifier_time
		}
		random_interest_group = {
			limit = {
				is_insurrectionary = yes
				leader = { has_ideology = ideology_radical }
			}
			leader = { save_scope_as = radical_ig_leader }
		}
		if = {
			limit = {
				NOT = { has_technology_researched = egalitarianism }
			}
			add_technology_researched = egalitarianism
		}
	}

	duration = 3

	option = {
		name = peoples_springtime.1.a
		scope:radical_ig_leader = {
			add_modifier = {
				name = revolutionary_hero
				months = normal_modifier_time
			}
		}
	}

    option = {
		name = peoples_springtime.1.b
        default_option = yes
        scope:radical_ig_leader = {
        	add_modifier = {
        		name = treasonous_traitor
        		months = normal_modifier_time
        	}
        }
	}
}

# The Spread
# Neighboring country has the Journal Entry
peoples_springtime.2 = {
	type = country_event
	event_image = {
		video = "gfx/event_pictures/europenorthamerica_political_extremism.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/political_extremism"

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

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

	trigger = {
		# Triggered by peoples_springtime.4
	}

	duration = 3

	immediate = {
		random_interest_group = {
			limit = {
				is_marginal = no
				OR = {
					is_interest_group_type = ig_rural_folk
					is_interest_group_type = ig_intelligentsia
					is_interest_group_type = ig_trade_unions
					is_interest_group_type = ig_petty_bourgeoisie
					is_interest_group_type = ig_industrialists
				}
				leader = {
					NOT = { has_ideology = ideology_radical }
				}
			}
			save_scope_as = radical_ig
		}
	}

	option = {
		name = peoples_springtime.2.a
		scope:radical_ig = {
			leader = { set_ideology = ideology_radical }
			add_modifier = {
				name = revolutionary_hero
				months = normal_modifier_time
			}

		}
	}

    option = {
		name = peoples_springtime.2.b
        default_option = yes
        scope:radical_ig = {
        	leader = { set_ideology = ideology_radical }
        	add_modifier = {
        		name = treasonous_traitor
        		months = normal_modifier_time
        	}
        }
	}
}

# More Radical Leaders
# Once you have the Journal Entry, more IGs want in on the action
peoples_springtime.3 = {
	type = country_event
	event_image = {
		video = "gfx/event_pictures/europenorthamerica_political_extremism.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/political_extremism"

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

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

	trigger = {
		has_journal_entry = je_springtime_of_the_peoples
		has_technology_researched = egalitarianism

		any_interest_group = {
			OR = {
				is_interest_group_type = ig_rural_folk
				is_interest_group_type = ig_intelligentsia
				is_interest_group_type = ig_trade_unions
				is_interest_group_type = ig_petty_bourgeoisie
				is_interest_group_type = ig_industrialists
			}
			leader = {
				NOT = { has_ideology = ideology_radical }
			}
		}
	}

	immediate = {
		random_interest_group = {
			limit = {
				OR = {
					is_interest_group_type = ig_rural_folk
					is_interest_group_type = ig_intelligentsia
					is_interest_group_type = ig_trade_unions
					is_interest_group_type = ig_petty_bourgeoisie
					is_interest_group_type = ig_industrialists
				}
				leader = {
					NOT = { has_ideology = ideology_radical }
				}
			}
			save_scope_as = radical_ig
		}
	}

	duration = 3

	option = {
		name = peoples_springtime.3.a
		custom_tooltip = {
			text = peoples_springtime.3.a.tt
			create_character = {
				ig_leader = yes
				ideology = ideology_radical
				interest_group = scope:radical_ig
			}
		}
	}

	option = {
		name = peoples_springtime.3.b
		scope:radical_ig = {
			add_modifier = {
				name = dissident_radical_faction
				months = short_modifier_time
			}
		}
		default_option = yes
	}
}

# Propagation
# Deliberately spread Radicalism to neighbor
peoples_springtime.4 = {
	type = country_event
	event_image = {
		video = "gfx/event_pictures/europenorthamerica_political_extremism.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/political_extremism"

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

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

	trigger = {
		has_journal_entry = je_springtime_of_the_peoples
		any_neighbouring_state = {
			owner = {
				has_technology_researched = egalitarianism
				any_interest_group = {
					is_powerful = yes
					OR = {
						is_interest_group_type = ig_rural_folk
						is_interest_group_type = ig_intelligentsia
						is_interest_group_type = ig_trade_unions
						is_interest_group_type = ig_petty_bourgeoisie
						is_interest_group_type = ig_industrialists
					}
					leader = {
						NOT = { has_ideology = ideology_radical }
					}
				}
			}
		}
		any_interest_group = {
			leader = { has_ideology = ideology_radical }
		}
	}

	duration = 3

	cooldown = { months = normal_modifier_time }

	option = {
		name = peoples_springtime.4.a
		random_neighbouring_state = {
			limit = {
				owner = {
					has_technology_researched = egalitarianism
					any_interest_group = {
						is_powerful = yes
						OR = {
							is_interest_group_type = ig_rural_folk
							is_interest_group_type = ig_intelligentsia
							is_interest_group_type = ig_trade_unions
							is_interest_group_type = ig_petty_bourgeoisie
							is_interest_group_type = ig_industrialists
						}
						leader = {
							NOT = { has_ideology = ideology_radical }
						}
					}
				}
			}
			owner = {
				trigger_event = {
					id = peoples_springtime.2
					days = 0
				}
			}
		}
		every_interest_group = {
			limit = {
				leader = { has_ideology = ideology_radical }
			}
			add_modifier = {
				name = spread_the_revolution
				months = short_modifier_time
			}
		}
	}

	option = {
		name = peoples_springtime.4.b
		every_interest_group = {
			limit = {
				leader = { has_ideology = ideology_radical }
			}
			add_modifier = {
				name = constrained_the_revolution
				months = short_modifier_time
			}
		}
		default_option = yes
	}
}

# Low-key Revolutionary activity causes Turmoil
peoples_springtime.5 = {
	type = country_event
	event_image = {
		video = "gfx/event_pictures/europenorthamerica_springtime_of_nations.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/springtime_of_nation"

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

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

	trigger = {
		has_journal_entry = je_springtime_of_the_peoples
		any_interest_group = {
			leader = { has_ideology = ideology_radical }
			ig_approval <= unhappy
		}
	}

	duration = 3

	option = {
		name = peoples_springtime.5.a
		random_scope_state = {
			add_radicals = {
				value = very_large_radicals
			}
		}
	}

	option = {
		name = peoples_springtime.5.b
		capital = {
			add_radicals = {
				value = very_large_radicals
			}
		}
		default_option = yes
	}
}

# End of the Springtime of the Peoples
peoples_springtime.6 = {
	type = country_event
	event_image = {
		video = "gfx/event_pictures/europenorthamerica_political_extremism.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/political_extremism"

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

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

	trigger = {
		OR = {
			has_variable = completed_peoples_stringtime
			has_journal_entry = je_springtime_of_the_peoples
		}
		has_global_variable = peoples_springtime_happening
		NOT = { has_global_variable = peoples_springtime_recent }
		NOT = {
			any_country = {
				has_variable = completed_peoples_stringtime_recent
			}
		}

	}

	duration = 3

	option = {
		name = peoples_springtime.6.a
		custom_tooltip = peoples_springtime.6.a.tt
		hidden_effect = {
			if = {
				limit = {
					NOT = { has_global_variable = peoples_springtime_happened }
				}
				every_country = {
					limit = {
						OR = {
							has_journal_entry = je_springtime_of_the_peoples
							has_variable = completed_peoples_stringtime
						}
						NOT = { this = root }
					}
					trigger_event = {
						id = peoples_springtime.6
						days = 1
					}
				}
			}
			set_global_variable = {
				name = peoples_springtime_happened
				value = yes
			}
		}
		default_option = yes
	}
}

# The Revolution Victorious
peoples_springtime.7 = {
	type = country_event

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_political_extremism.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/political_extremism"

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

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

	duration = 3

	immediate = {
		random_interest_group = {
			limit = {
				is_in_government = yes
				leader = { has_ideology = ideology_radical }
			}
			save_scope_as = radical_ig
		}
	}

	option = {
		name = peoples_springtime.7.a
		add_modifier = {
			name = post_revolutionary_fervor
			months = normal_modifier_time
		}
	}

	option = {
		name = peoples_springtime.7.b
		default_option = yes
		add_loyalists = {
			value = 0.1
		}
	}
}

# The Revolution Vanquished
peoples_springtime.8 = {
	type = country_event

	event_image = {
		video = "gfx/event_pictures/middleeast_police_breaking_door.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/middleeast/police_breaking_door"

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

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

	duration = 3

	option = {
		name = peoples_springtime.8.a
		add_modifier = {
			name = counter_revolutionary_fervor
			months = normal_modifier_time
		}
	}

	option = {
		name = peoples_springtime.8.b
		default_option = yes
		add_loyalists = {
			value = 0.1
		}
	}
}