﻿# triggered by on_law_enactment_started
je_abolish_monarchy = {
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	
	group = je_group_internal_affairs

	on_monthly_pulse = {
		effect = {
			if = {
				limit = {
					NOT = { has_law = law_type:law_monarchy }
					NOT = {
						any_civil_war = {
							civil_war_progress >= 0.75
							is_civil_war_type = revolution
						}
					}
					NOT = {
						any_interest_group = {
							law_stance = {
								law = law_type:law_monarchy
								value > neutral
							}
							is_powerful = yes
						}
					}
				}
				change_variable = {
					name = abolishing_monarchy_var
					add = 1
				}
			}
		}
	}

	complete = {
		scope:journal_entry = {
			is_goal_complete = yes
		}
		NOT = { has_law = law_type:law_monarchy }
		NOT = {
			any_civil_war = {
				civil_war_progress >= 0.75
				is_civil_war_type = revolution
			}
		}
		NOT = {
			any_interest_group = {
				law_stance = {
					law = law_type:law_monarchy
					value > neutral
				}
				is_powerful = yes
			}
		}
	}

	on_complete = {
		set_variable = stamped_out_monarchy_var
		trigger_event = {
			id = 1848.2
		}
		if = {
			limit = { has_journal_entry = je_warlord_china }
			chi_add_1_fragile_unity = yes
			set_variable = china_warlord_abolished_monarchy
		}
	}

	invalid = {
		NOR = {
			is_enacting_law = law_type:law_presidential_republic
			is_enacting_law = law_type:law_parliamentary_republic
			is_enacting_law = law_type:law_council_republic
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
			has_law = law_type:law_council_republic
		}
	}

	current_value = {
		value = root.var:abolishing_monarchy_var
	}

	goal_add_value = {
		add = 60
	}

	progressbar = yes

	weight = 100
}