﻿law_no_migration_controls = {
	group = lawgroup_migration
	icon = "gfx/interface/icons/law_icons/no_migration_controls.dds"
	
	progressiveness = 50

	modifier = {
		country_leverage_resistance_mult = -0.25
	}

	ai_enact_weight_modifier = { #Petitions
		value = 0
		
		if = {
			limit = { ai_has_enact_weight_modifier_journal_entries = yes }
			add = 750
		}
	}
}

law_migration_controls = {
	group = lawgroup_migration
	icon = "gfx/interface/icons/law_icons/migration_controls.dds"
	
	modifier = {
		country_migration_restrictiveness_add = 60	
	}
	
	progressiveness = 0

	on_enact = {
		if = {
			limit = {
				c:CHI ?= this
				has_journal_entry = je_chinese_missions
			}
			every_scope_state = {
				limit = {
					NOT = {
						any_neighbouring_state = {
							is_treaty_port = yes
							owner = {
								religion = {
									has_discrimination_trait = christian
								}
							}
						}
					}
					has_variable = open_to_missionaries_state
				}
				remove_variable = open_to_missionaries_state
			}
		}
	}

	ai_enact_weight_modifier = { #Petitions
		value = 0
		
		if = {
			limit = { ai_has_enact_weight_modifier_journal_entries = yes }
			add = 750
		}
		
		if = {
			limit = { 
				has_journal_entry = je_meiji_diplomacy
				has_law = law_type:law_closed_borders
			}
			add = 1000
		}			
	}
}

law_closed_borders = {
	group = lawgroup_migration
	icon = "gfx/interface/icons/law_icons/closed_borders.dds"

	modifier = {
		country_migration_restrictiveness_add = 100
		country_disallow_agitator_invites_bool = yes
		country_leverage_resistance_mult = 0.25
	}
	
	progressiveness = -50

	on_enact = {
		if = {
			limit = {
				c:CHI ?= this
				has_journal_entry = je_chinese_missions
			}
			every_scope_state = {
				limit = {
					NOT = {
						any_neighbouring_state = {
							is_treaty_port = yes
							owner = {
								religion = {
									has_discrimination_trait = christian
								}
							}
						}
					}
					has_variable = open_to_missionaries_state
				}
				remove_variable = open_to_missionaries_state
			}
		}
	}

	ai_enact_weight_modifier = { #Petitions
		value = 0
		
		if = {
			limit = { ai_has_enact_weight_modifier_journal_entries = yes }
			add = 750
		}
	}
}
