namespace = sick_man

# start event
sick_man.1 = {
	type = country_event
	placement = root
	title = sick_man.1.t
	desc = sick_man.1.d
	flavor = dvg_sick_man.1.f

	duration = 3

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

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

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

	trigger = {
	}

	immediate = {
		set_variable = {
			name = sick_man_var
			value = 0
		}
		set_variable = {
			name = sick_man_separatist_var
			value = 0
		}
		add_journal_entry = {
			type = je_sick_man_main
		}
	}

	option = {
		name = sick_man.1.a
		add_journal_entry = {
			type = je_sick_man_macedonia
		}
		add_journal_entry = {
			type = je_sick_man_iraq
		}
		add_journal_entry = {
			type = je_sick_man_economy
		}
		add_journal_entry = {
			type = je_sick_man_education
		}
		add_journal_entry = {
			type = je_sick_man_separatism
		}
		add_journal_entry = {
			type = je_sick_man_army
		}
		add_journal_entry = {
			type = je_sick_man_bureaucracy
		}
		show_as_tooltip = {
			add_modifier = {
				name = sick_man_of_europe
				months = -1
			}		
			add_modifier = {
				name = outmoded_bureaucracy
				months = -1
			}
			add_modifier = {
				name = cizye_tax
				months = -1
			}			
		}
	}
}

# Success event
sick_man.2 = {
	type = country_event
	placement = root
	title = sick_man.2.t
	desc = sick_man.2.desc
	flavor = sick_man.2.f

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

	duration = 3

	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"

	trigger = {
	}

	immediate = {
		set_variable = sick_man_complete
		remove_modifier = outmoded_bureaucracy
		remove_modifier = cizye_tax
		if = { 
			limit = {
				has_variable = completed_sick_man_macedonia_je
			}
			add_journal_entry = {
				type = je_tur_reclaim_serbia
			}
		} 
		else = {
			add_journal_entry = {
				type = je_tur_reclaim_macedonia
			}
		}

		if = { 
			limit = {
				AND = {
					has_variable = completed_sick_man_macedonia_je
					NOT = {
						has_variable = completed_sick_man_albania_je
					}
				}
			}
			add_journal_entry = {
				type = je_tur_reclaim_albania
			}
		}

		if = { 
			limit = {
				NOT = {
					has_variable = completed_sick_man_iraq_je
				}
			}
			add_journal_entry = {
				type = je_tur_reclaim_iraq
			}
		}
	}

	option = {
		name = sick_man.2.a
		default_option = yes
		trigger = {
			has_variable = completed_sick_man_army_je
		}
		add_modifier = {
			name = ottoman_army_reform
			months = normal_modifier_time
		}
	}
	option = {
		name = sick_man.2.b
		trigger = {
			OR = {
				has_variable = completed_sick_man_macedonia_je
				has_variable = completed_separatism_sick_man_je
			}
			NAND = {
				owns_entire_state_region = STATE_ATTICA
				owns_entire_state_region = STATE_PELOPONNESE
				owns_entire_state_region = STATE_CRETE
			}
		}
		s:STATE_ATTICA = {
			add_claim = ROOT
		}
		s:STATE_PELOPONNESE = {
			add_claim = ROOT
		}
		s:STATE_CRETE = {
			add_claim = ROOT
		}
	}
	option = {
		name = sick_man.2.c
		trigger = {
			has_variable = completed_sick_man_economy_je
		}
		add_modifier = {
			name = ottoman_urbanization
			months = normal_modifier_time
		}
	}
	option = {
		name = sick_man.2.d
		trigger = {
			has_variable = completed_sick_man_education_je
		}
		add_modifier = {
			name = ottoman_education
			months = normal_modifier_time
		}
	}
	option = {
		name = sick_man.2.e
		trigger = {
			has_variable = completed_sick_man_bureaucracy_je
		}
		add_modifier = {
			name = ottoman_bureaucracy
			months = normal_modifier_time
		}
	}
}

# Fail event
sick_man.3 = {
	type = country_event
	placement = root
	title = sick_man.3.t
	desc = sick_man.3.d
	flavor = sick_man.3.f
	icon = "gfx/interface/icons/event_icons/event_skull.dds"

	duration = 3

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

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

	trigger = {
	}

	immediate = {
		set_variable = sick_man_complete
		remove_modifier = outmoded_bureaucracy
		remove_modifier = cizye_tax
		ruler = {
			save_scope_as = ottoman_sultan
		}
	}

	option = {
		name = sick_man.3.a
		if = {
			limit = {
				any_subject_or_below = {
					NOT = {
						is_country_type = unrecognized
					}
				}
			}
			every_subject_or_below = {
				limit = {
					OR = {
						NOT = {
							is_country_type = unrecognized
						}
						is_subject_type = subject_type_protectorate
						is_subject_type = subject_type_dominion
						is_subject_type = subject_type_puppet
					}
				}
				make_independent = yes
			}
		}
		set_country_type = unrecognized
		ruler = {
			kill_character = yes
		}
	}
}
