﻿namespace = monarchy_law_events

# Popular Acclamation
monarchy_law_events.1 = { # Republic-to-Monarchy Advancement
	type = country_event

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

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

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/leader_speaking_to_a_group_of_people"

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

	duration = 3

	cooldown = { months = normal_modifier_time }
	
	trigger = {
		OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
			has_law = law_type:law_council_republic
		}
		NOT = {
			has_modifier = monarchist_agitation
		}
		OR = { is_enacting_law = law_type:law_monarchy is_enacting_law = law_type:law_legitimist_monarchy is_enacting_law = law_type:law_orleanist_monarchy is_enacting_law = law_type:law_bonapartist_monarchy }
		any_interest_group = {
			is_marginal = no
			law_stance = {
				law = owner.currently_enacting_law.type
				value > neutral
			}
		}
	}
	
	immediate = {
		currently_enacting_law = {
			save_scope_as = current_law_scope
		}
		random_interest_group = {
			limit = {
				is_marginal = no
				law_stance = {
					law = owner.currently_enacting_law.type
					value > neutral
				}
			}
			save_scope_as = monarchist_ig_scope
			leader = {
				save_scope_as = monarchist_ig_leader_scope
			}
		}
	}

	cancellation_trigger = {
		NOT = { currently_enacting_law = scope:current_law_scope }
	}

	option = {
		name = monarchy_law_events.1.a
        default_option = yes

		add_enactment_modifier = {
			name = monarchist_agitation
		}
		scope:monarchist_ig_leader_scope = {
			add_modifier = {
				name = the_man_of_the_hour
				months = normal_modifier_time
			}
		}
	}

	option = {
		name = monarchy_law_events.1.b

		add_enactment_modifier = {
			name = monarchist_agitation
		}
		scope:monarchist_ig_scope = {
			add_modifier = {
				name = attracting_notables
				months = normal_modifier_time
			}
		}
	}
}

# Worldly Whispers
monarchy_law_events.2 = { # Theocracy-to-Monarchy Advancement
	type = country_event

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

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

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/leader_speaking_to_a_group_of_people"

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

	duration = 3

	cooldown = { months = normal_modifier_time }
	
	trigger = {
		has_law = law_type:law_theocracy
		OR = { is_enacting_law = law_type:law_monarchy is_enacting_law = law_type:law_legitimist_monarchy is_enacting_law = law_type:law_orleanist_monarchy is_enacting_law = law_type:law_bonapartist_monarchy }
		any_interest_group = {
			is_marginal = no
			law_stance = {
				law = owner.currently_enacting_law.type
				value > neutral
			}
		}
		NOT = {
			has_modifier = monarchist_agitation
		}
	}
	
	immediate = {
		currently_enacting_law = {
			save_scope_as = current_law_scope
		}
		random_interest_group = {
			limit = {
				is_marginal = no
				law_stance = {
					law = owner.currently_enacting_law.type
					value > neutral
				}
			}
			save_scope_as = monarchist_ig_scope
		}
		random_scope_character = {
			limit = {
				is_ruler = yes
			}
			save_scope_as = secularizing_spiritualist
		}
	}

	cancellation_trigger = {
		NOT = { currently_enacting_law = scope:current_law_scope }
	}

	option = {
		name = monarchy_law_events.2.a
        default_option = yes

		add_enactment_modifier = {
			name = monarchist_agitation
		}
		scope:secularizing_spiritualist = {
			add_modifier = {
				name = monarchist_spiritualist
				months = normal_modifier_time
			}
		}
	}

	option = {
		name = monarchy_law_events.2.b

		add_enactment_modifier = {
			name = monarchist_agitation
		}
		scope:monarchist_ig_scope = {
			add_modifier = {
				name = attracting_notables
				months = normal_modifier_time
			}
		}
	}
}

# Imported Bluebloods?
monarchy_law_events.3 = { # debate
	type = country_event

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

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

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/election"

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

	duration = 3

	cooldown = { months = normal_modifier_time }
	
	trigger = {
		OR = { is_enacting_law = law_type:law_monarchy is_enacting_law = law_type:law_legitimist_monarchy is_enacting_law = law_type:law_orleanist_monarchy is_enacting_law = law_type:law_bonapartist_monarchy }
		any_interest_group = {
			is_in_government = no
			is_marginal = no
			law_stance = {
				law = owner.currently_enacting_law.type
				value > neutral
			}
		}
		NOT = {
			has_variable = monarchy_law_debate_timer
		}
		any_neighbouring_state = {
			owner = {
				OR = {
					has_law = law_type:law_monarchy
					has_law = law_type:law_legitimist_monarchy
					has_law = law_type:law_orleanist_monarchy
					has_law = law_type:law_bonapartist_monarchy
				}
			}
		}
	}

	immediate = {
		currently_enacting_law = {
			save_scope_as = current_law_scope
		}
		random_neighbouring_state  = {
			limit = {
				owner = {
					OR = {
						has_law = law_type:law_monarchy
						has_law = law_type:law_legitimist_monarchy
						has_law = law_type:law_orleanist_monarchy
						has_law = law_type:law_bonapartist_monarchy
					}
				}
			}
			owner = {
				save_scope_as = neighboring_monarchy
			}
		}
		set_variable = {
			name = monarchy_law_debate_timer
			days = 730 # two years
		}
	}

	cancellation_trigger = {
		NOT = { currently_enacting_law = scope:current_law_scope }
	}

	option = {
		name = monarchy_law_events.3.a
		default_option = yes
		add_enactment_modifier = {
			name = monarchist_debate
		}
	}
	option = {
		name = monarchy_law_events.3.b
		random_list = {
			1 = {
				add_enactment_modifier = {
					name = monarchist_debate_success
				}
			}
			3 = {
				add_enactment_modifier = {
					name = monarchist_debate_fail
				}
			}
		}
	}
}

monarchy_law_events.4 = { # Stall event
	type = country_event
	placement = root
	title = monarchy_law_events.4.t
	desc = monarchy_law_events.4.d
	flavor = monarchy_law_events.4.f

	duration = 3

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

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/leader_speaking_to_a_group_of_people"

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

	cooldown = { months = normal_modifier_time }

	trigger = {
		OR = { is_enacting_law = law_type:law_monarchy is_enacting_law = law_type:law_legitimist_monarchy is_enacting_law = law_type:law_orleanist_monarchy is_enacting_law = law_type:law_bonapartist_monarchy }
		any_interest_group = {
			is_marginal = no
			law_stance = {
				law = owner.currently_enacting_law.type
				value > neutral
			}
		}
		NOT = {
			has_variable = monarchist_law_stall_timer
		}	
	}

	immediate = {
		currently_enacting_law = {
    		save_scope_as = current_law_scope
    	}

    	random_interest_group = {
			limit = {
				is_marginal = no
				law_stance = {
					law = owner.currently_enacting_law.type
					value > neutral
				}
			}
			save_scope_as = book_burning_ig
    	}

		set_variable = {
			name = monarchist_law_stall_timer
			days = 730 # two years
		}
	}

	cancellation_trigger = {
		NOT = { currently_enacting_law = scope:current_law_scope }
	}

	option = {
		name = monarchy_law_events.4.a
		default_option = yes
		add_enactment_modifier = {
			name = monarchist_stall
		}
	}
	option = { 
		name = monarchy_law_events.4.b
		random_list = {
			1 = {
				add_enactment_modifier = {
					name = monarchist_stall_fail
				}
			}
			3 = {
				add_enactment_modifier = {
					name = monarchist_stall_success
				}
			}
		}
	}
}
