﻿namespace = republic_laws


republic_laws.1 = { #King misses meeting
	type = country_event
	placement = ROOT
	
	title = republic_laws.1.t
	desc = republic_laws.1.d
	flavor = republic_laws.1.f
	
	event_image = {
		video = "gfx/event_pictures/unspecific_politicians_arguing.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/politician_parliament_motion"

	icon = "gfx/interface/icons/event_icons/event_election.dds"
	
	duration = 3

	cooldown = { months = normal_modifier_time }
	
	trigger = {
		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 }
		or = {
			is_enacting_law = law_type:law_presidential_republic
			is_enacting_law = law_type:law_parliamentary_republic
		}
		NOT = {
			has_modifier = republic_representation
		}
	}

	immediate = {
		currently_enacting_law = {
			save_scope_as = current_law_scope
		}
	}

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

	option = { #Do we need a king?
		name = republic_laws.1.a
		default_option = yes
		random_list = {
			2 = {
				add_enactment_modifier = {
					name = republic_representation
					multiplier = 4
				}
			}
			3 = {
				add_enactment_modifier = {
					name = republic_representation
				}
			}
		}
	}

	option = { #Best to tread softly
		name = republic_laws.1.b
		add_enactment_modifier = {
			name = republic_representation
			multiplier = 2
		}
	}

	option = { #publish it in the paper
		name = republic_laws.1.c
		trigger = {
			or = {
				has_law = law_type:law_right_of_assembly
				has_law = law_type:law_protected_speech
			}	
		}
		add_enactment_modifier = {
			name = republic_representation
			multiplier = 6
		}
	}
}

republic_laws.2 = { #Fate of the King
	type = country_event
	placement = ROOT
	
	title = republic_laws.2.t
	desc = republic_laws.2.d
	flavor = republic_laws.2.f
	
	event_image = {
		video = "gfx/event_pictures/europenorthamerica_london_center.bk2"
	}

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

	icon = "gfx/interface/icons/event_icons/event_election.dds"
	
	duration = 3

	cooldown = { months = normal_modifier_time }
	
	trigger = {
		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 }
		or = {
			is_enacting_law = law_type:law_presidential_republic
			is_enacting_law = law_type:law_parliamentary_republic
		}
		NOT = {
			has_modifier = fate_of_the_monarchy
		}
		OR = {
			AND = {
				has_law = law_type:law_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value > neutral
					}
				}
			}	
			AND = {
				has_law = law_type:law_legitimist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value > neutral
					}
				}
			}	
			AND = {
				has_law = law_type:law_orleanist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value > neutral
					}
				}
			}
			AND = {
				has_law = law_type:law_bonapartist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value > neutral
					}
				}
			}
		}
	}

	immediate = {
		currently_enacting_law = {
			save_scope_as = current_law_scope
		}
		if = {
			limit = {
				has_law = law_type:law_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_fate
				leader = {
					save_scope_as = monarchist_supporter
				}
			}
		}	
		if = {
			limit = {
				has_law = law_type:law_legitimist_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_fate
				leader = {
					save_scope_as = monarchist_supporter
				}
			}
		}	
		if = {
			limit = {
				has_law = law_type:law_orleanist_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_fate
				leader = {
					save_scope_as = monarchist_supporter
				}
			}
		}	
		if = {
			limit = {
				has_law = law_type:law_bonapartist_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_fate
				leader = {
					save_scope_as = monarchist_supporter
				}
			}
		}
	}

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

	option = { #keep the king around
		name = republic_laws.2.a
		default_option = yes
		add_enactment_modifier = {
			name = fate_of_the_monarchy 
		}
	}

	option = { #Exile the king
		name = republic_laws.2.b
		scope:rulers_fate = {
			add_modifier = {
				name = exile_the_monarch
				months = normal_modifier_time
			}
		}
		add_enactment_modifier = {
			name = fate_of_the_monarchy
			multiplier = 2
		}
	}
}

republic_laws.3 = { #The kings Speech
	type = country_event
	placement = ROOT
	
	title = republic_laws.3.t
	desc = republic_laws.3.d
	flavor = republic_laws.3.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_election.dds"
	
	duration = 3

	cooldown = { months = normal_modifier_time }
	
	trigger = {
		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 }
		or = {
			is_enacting_law = law_type:law_presidential_republic
			is_enacting_law = law_type:law_parliamentary_republic
		}
		NOT = {
			has_modifier = the_kings_speech
		}
		OR = {
			AND = {
				has_law = law_type:law_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value > neutral
					}
				}
			}	
			AND = {
				has_law = law_type:law_legitimist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value > neutral
					}
				}
			}	
			AND = {
				has_law = law_type:law_orleanist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value > neutral
					}
				}
			}
			AND = {
				has_law = law_type:law_bonapartist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value > neutral
					}
				}
			}
		}
	}

	immediate = {
		currently_enacting_law = {
			save_scope_as = current_law_scope
		}
		if = {
			limit = {
				has_law = law_type:law_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value < neutral
					}
				}
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value < neutral
					}
				}
				save_scope_as = rulers_speech_opposition
			}
		}
		if = {
			limit = {
				has_law = law_type:law_legitimist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value < neutral
					}
				}
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value < neutral
					}
				}
				save_scope_as = rulers_speech_opposition
			}
		}
		if = {
			limit = {
				has_law = law_type:law_orleanist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value < neutral
					}
				}
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value < neutral
					}
				}
				save_scope_as = rulers_speech_opposition
			}
		}
		if = {
			limit = {
				has_law = law_type:law_bonapartist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value < neutral
					}
				}
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value < neutral
					}
				}
				save_scope_as = rulers_speech_opposition
			}
		}
		if = {
			limit = {
				has_law = law_type:law_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_speech_supporters
			}
		}
		if = {
			limit = {
				has_law = law_type:law_legitimist_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_speech_supporters
			}
		}
		if = {
			limit = {
				has_law = law_type:law_orleanist_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_speech_supporters
			}
		}
		if = {
			limit = {
				has_law = law_type:law_bonapartist_monarchy
			}
			random_interest_group = {
				limit = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value > neutral
					}
				}
				save_scope_as = rulers_speech_supporters
			}
		}
	}

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

	option = { #Kings speech unchallenged
		name = republic_laws.3.a
		default_option = yes
		if = {
			limit = {
				has_law = law_type:law_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					multiplier = -1
					months = normal_modifier_time
				}
			}
		}
		if = {
			limit = {
				has_law = law_type:law_legitimist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					multiplier = -1
					months = normal_modifier_time
				}
			}
		}
		if = {
			limit = {
				has_law = law_type:law_orleanist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					multiplier = -1
					months = normal_modifier_time
				}
			}
		}
		if = {
			limit = {
				has_law = law_type:law_bonapartist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					multiplier = -1
					months = normal_modifier_time
				}
			}
		}
		scope:rulers_speech_supporters = {
			add_modifier = {
				name = speech_supporters
				multiplier = 2
				months = normal_modifier_time
			}
		}
		random_list = {
			1 = {
				add_enactment_modifier = {
					name =  the_kings_speech
					multiplier = -3
				}
			}
			3 = {
				add_enactment_modifier = {
					name =  the_kings_speech
					multiplier = -2
				}
			}
		}
	}

	option = { #Kings speech challenged
		name = republic_laws.3.b
		scope:rulers_speech_supporters = {
			add_modifier = {
				name = speech_supporters
				multiplier = -1
				months = normal_modifier_time
			}
		}
		if = {
			limit = {
				has_law = law_type:law_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					months = normal_modifier_time
				}
			}
		}
		if = {
			limit = {
				has_law = law_type:law_legitimist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_legitimist_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					months = normal_modifier_time
				}
			}
		}
		if = {
			limit = {
				has_law = law_type:law_orleanist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_orleanist_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					months = normal_modifier_time
				}
			}
		}
		if = {
			limit = {
				has_law = law_type:law_bonapartist_monarchy
				any_interest_group = {
					is_marginal = no
					law_stance = {
						law = law_type:law_bonapartist_monarchy
						value < neutral
					}
				}
			}
			scope:rulers_speech_opposition = {
				add_modifier = {
					name = speech_opposition
					months = normal_modifier_time
				}
			}
		}
		add_enactment_modifier = {
			name =  the_kings_speech
			multiplier = -1
		}
	}
}