shogunate_mechanic = {
	alert_icon_gfx = GFX_alerticons_government_mechanics
	alert_icon_index = 16
	available = {
		has_dlc = "Mandate of Heaven"
	}
	
	interactions = {
		expel_ronin = {
			icon = GFX_expel_ronin
			trigger = {
				legitimacy = 50
				any_subject_country = {
					is_subject_of_type = daimyo_vassal
				}
			}
			effect = { 
				add_legitimacy = -15
				add_country_modifier = {
					name = overlord_expel_ronin
					duration = 3650
				}
				add_adm_power = 100 
				custom_tooltip = shogun_every_daimyo_expel_ronin_tt
				hidden_effect = {
					every_subject_country = {
						limit = {
							is_subject_of_type = daimyo_vassal
						}
						add_country_modifier = {
							name = subject_expel_ronin
							duration = 3650
							message = MULTISUBJECTINTERACT
							message_data = expel_ronin
						}
					}
				}
			}
			cooldown_years = 10
			ai_chance = {
				factor = 0
				modifier = {
					factor = 50
					num_subjects_of_type_with_liberty_desire = {
						type = daimyo_vassal
						liberty_desire = 50
						value = 2
					}
					legitimacy = 99
				}
				modifier = {
					factor = 25
					num_subjects_of_type_with_liberty_desire = {
						type = daimyo_vassal
						liberty_desire = 50
						value = 3
					}
					legitimacy = 99
				}
				modifier = {
					factor = 25
					num_subjects_of_type_with_liberty_desire = {
						type = daimyo_vassal
						liberty_desire = 50
						value = 4
					}
					legitimacy = 99
				}
				modifier = {
					factor = 25
					num_subjects_of_type_with_liberty_desire = {
						type = daimyo_vassal
						liberty_desire = 50
						value = 5
					}
					legitimacy = 99
				}
			}
		}
		sankin_kotai = {
			icon = GFX_sankin_kotai
			trigger = { 
				legitimacy = 50
				any_subject_country = {
					is_subject_of_type = daimyo_vassal
				}
			}
			effect = { 
				add_legitimacy = -15
				add_country_modifier = {
					name = overlord_sankin_kotai
					duration = 3650
				}
				add_dip_power = 100
				custom_tooltip = shogun_every_daimyo_sankin_kotai_tt
				hidden_effect = {
					every_subject_country = {
						limit = {
							is_subject_of_type = daimyo_vassal
						}
						add_country_modifier = {
							name = subject_sankin_kotai
							duration = 3650
							message = MULTISUBJECTINTERACT
							message_data = sankin_kotai
						}
					}
				}
			}
			cooldown_years = 10
			ai_chance = {
				factor = 0
				modifier = {
					factor = 28
					NOT = { diplomatic_reputation = 0 }
					legitimacy = 99
				}
				modifier = {
					factor = 8
					NOT = { diplomatic_reputation = -0.5 }
					legitimacy = 99
				}
				modifier = {
					factor = 9
					NOT = { diplomatic_reputation = -1 }
					legitimacy = 99
				}
				modifier = {
					factor = 10
					NOT = { diplomatic_reputation = -1.5 }
					legitimacy = 99
				}
				modifier = {
					factor = 11
					NOT = { diplomatic_reputation = -2 }
					legitimacy = 99
				}
				modifier = {
					factor = 12
					NOT = { diplomatic_reputation = -2.5 }
					legitimacy = 99
				}
				modifier = {
					factor = 13
					NOT = { diplomatic_reputation = -3 }
					legitimacy = 99
				}
			}
		}
		sword_hunt = {
			icon = GFX_sword_hunt
			trigger = {
				legitimacy = 50
				any_subject_country = {
					is_subject_of_type = daimyo_vassal
				}
			}
			effect = {
				add_legitimacy = -15
				add_country_modifier = {
					name = overlord_sword_hunt
					duration = 3650            
				}
				add_mil_power = 100
				custom_tooltip = shogun_every_daimyo_sword_hunt_tt
				hidden_effect = {
					add_country_modifier = {
						name = overlord_sword_hunt
						duration = 3650      
					}
					every_subject_country = {
						limit = {
							is_subject_of_type = daimyo_vassal
						}
						add_country_modifier = {
							name = subject_sword_hunt
							duration = 3650
							message = MULTISUBJECTINTERACT
							message_data = sword_hunt
						}
					}
				}
			}
			cooldown_years = 10
			ai_chance = {
				factor = 0
				modifier = {
					factor = 30
					NOT = { manpower_percentage = 0.6 }
					legitimacy = 99
				}
				modifier = {
					factor = 7.5
					NOT = { manpower_percentage = 0.5 }
					legitimacy = 99
				}
				modifier = {
					factor = 7.5
					NOT = { manpower_percentage = 0.4 }
					legitimacy = 99
				}
				modifier = {
					factor = 7.5
					NOT = { manpower_percentage = 0.3 }
					legitimacy = 99
				}
				modifier = {
					factor = 7.5
					NOT = { manpower_percentage = 0.2 }
					legitimacy = 99
				}
				modifier = {
					factor = 7.5
					NOT = { manpower_percentage = 0.1 }
					legitimacy = 99
				}
			}
		}
	}
}