incident_neo_confucianism = {

	frame = 1
	variable_initial = 0

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			NOT = { is_incident_active = yes }
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 200
	}

	immediate_effect = {
		country_event = { id = shinto_events.19 }
		set_country_flag = active_incident_flag
	}
}

incident_nanban = {

	frame = 2

	variable_initial = 4

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		is_institution_enabled = new_world_i
		num_of_ports = 1
		if = {
			limit = {
				normal_or_historical_nations = yes
				is_playing_custom_nation = no
			}
			custom_trigger_tooltip = {
				tooltip = japan_has_encountered_the_west_tooltip
				has_global_flag = japan_has_encountered_the_west
			}
		}
		if = {
			limit = {
				OR = {
					normal_or_historical_nations = no
					is_playing_custom_nation = yes
				}
			}
			custom_trigger_tooltip = {
				tooltip = encountered_other_continent_tooltip
				any_known_country = {
					NOT = { same_continent = ROOT }
				}
			}
		}
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			NOT = { has_country_flag = active_incident_flag }
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 200
		modifier = {
			factor = 0.7
			num_of_ports = 5
		}
	}

	immediate_effect = {
		country_event = { id = shinto_events.25 }
		set_country_flag = active_incident_flag
	}
}

incident_firearms = {

	frame = 3

	variable_initial = 1

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		is_incident_happened = incident_nanban
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			is_incident_active = no
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 150
	}

	immediate_effect = {
		country_event = { id = shinto_events.32 }
		set_country_flag = active_incident_flag
	}
}

incident_spread_of_christianity = {

	frame = 4

	variable_initial = 0

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		is_incident_happened = incident_nanban
		if = {
			limit = {
				normal_or_historical_nations = yes
			}
			custom_trigger_tooltip = {
				tooltip = japan_has_encountered_the_west_tooltip
				has_global_flag = japan_has_encountered_the_west
			}
		}
		custom_trigger_tooltip = {
			tooltip = encountered_christian_tooltip
			any_known_country = {
				religion_group = christian
			}
		}
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			NOT = { has_country_flag = active_incident_flag }
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 100
	}

	immediate_effect = {
		country_event = { id = shinto_events.38 }
		set_country_flag = active_incident_flag
	}
}

incident_shogunate_authority = {
#Stance on central authority - Sankin Kotai, etc

	frame = 5

	variable_initial = 0

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		has_reform = daimyo
		OR = {
			current_age = age_of_reformation
			current_age = age_of_absolutism
			current_age = age_of_revolutions
			current_age = industrial_age
			current_age = great_war_age
			current_age = information_age
		}
		OR = {
			overlord = {
				legitimacy = 90
			}
			overlord = {
				is_revolutionary = no
				absolutism = 50
			}
			AND = {
				is_revolutionary = no
				absolutism = 50
			}
		}
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			NOT = { has_country_flag = active_incident_flag }
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 200
	}

	immediate_effect = {
		country_event = { id = shinto_events.50 }
		set_country_flag = active_incident_flag
	}
}

incident_ikko_shu = {

	frame = 6

	variable_initial = 0

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		NOT = { current_age = age_of_discovery }
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			NOT = { has_country_flag = active_incident_flag }
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 200
	}

	immediate_effect = {
		country_event = { id = shinto_events.13 }
		set_country_flag = active_incident_flag
	}
}

incident_wokou = {

	frame = 7

	variable_initial = 0

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		num_of_ports = 1
		any_known_country = {
			num_of_ports = 1
			NOT = { religion = shinto }
		}
		any_neighbor_country = {
			exists = yes
		}
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			NOT = { has_country_flag = active_incident_flag }
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 200
	}

	immediate_effect = {
		country_event = { id = shinto_events.1 }
		set_country_flag = active_incident_flag
	}
}

incident_urbanization = {

	frame = 8

	variable_initial = 0

	potential = {
		has_dlc = "Mandate of Heaven"
		religion = shinto
	}

	trigger = {
		has_institution = global_trade
		num_of_cities = 2
		custom_trigger_tooltip = {
			tooltip = shinto_incident_recent_tooltip
			NOT = { has_country_flag = active_incident_flag }
			OR = {
				NOT = { has_country_flag = shinto_incident_recent }
				had_country_flag = { flag = shinto_incident_recent days = 10950 }
			}
		}
	}

	mean_time_to_happen = {
		months = 200
	}

	immediate_effect = {
		country_event = { id = shinto_events.7 }
		set_country_flag = active_incident_flag
	}
}


#New incidents MMETR for early Japan

#incident_korean_migration

