#Colonial Affairs (BPM seems to be vanilla in this law group)
REPLACE:law_frontier_colonization = {
	group = lawgroup_colonization
	#T&R
	can_enact = {
		OR = {
			AND = {
				country_is_colonial_or_company = yes
				any_decentralized_country = {
					is_adjacent_to_country = root
				}
			}
			any_scope_state = {
				is_homeland_of_country_cultures = ROOT
				any_neighbouring_state = {
					owner = {
						is_country_type = decentralized
					}
				}
			}
		}
		custom_tooltip = {
			text = ztr_un_hr_encouraged_decolonization_tt
			OR = {
				NOT = {
					ztr_is_un_member = yes
				}
				NOT = {
					global_var:ztr_un_hr_decolonization = 2
				}
			}
		}
	}
	icon = "gfx/interface/icons/law_icons/frontier_colonization.dds"
	progressiveness = 0
	disallowing_laws = {
		law_sakoku
	}
	unlocking_technologies = {
		colonization
	}
	modifier = {
		state_migration_pull_unincorporated_mult = 0.5
	}
	institution = institution_colonial_affairs
	#T&R
	can_impose = {
		OR = {
			AND = {
				is_in_same_power_bloc = scope:target_country
				AND = {
					modifier:country_can_impose_same_lawgroup_colonization_in_power_bloc_bool = yes
					has_law_or_variant = scope:law
				}
			}
			can_impose_law_default = yes
		}
		custom_tooltip = {
			text = ztr_un_hr_encouraged_decolonization_tt
			OR = {
				NOT = {
					ztr_is_un_member = yes
				}
				NOT = {
					global_var:ztr_un_hr_decolonization = 2
				}
			}
		}
	}
	ai_will_do = {
		NOR = {
			has_law_or_variant = law_type:law_colonial_exploitation
			has_law_or_variant = law_type:law_colonial_resettlement
		}
	}
	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_taming_the_north
			}
			add = 250
		}
	}
	ai_impose_chance = {
		value = 0
		if = {
			limit = {
				OR = {
					has_law_or_variant = law_type:law_colonial_resettlement
					has_law_or_variant = law_type:law_frontier_colonization
				}
				scope:target_country = {
					has_law_or_variant = law_type:law_no_colonial_affairs
				}
				power_bloc ?= {
					has_principle_group = principle_group:principle_group_colonial_offices
				}
			}
			add = 10
		}
		if = {
			limit = {
				scope:target_country = {
					c:BIC ?= this
					OR = {
						has_journal_entry = je_british_dictate_plantations
						has_journal_entry = je_british_dictate_military
						has_journal_entry = je_british_dictate_universities
					}
				}
			}
			multiply = 0
		}
	}
}

REPLACE:law_colonial_resettlement = {
	group = lawgroup_colonization
	icon = "gfx/interface/icons/law_icons/colonial_resettlement.dds"
	progressiveness = 0
	disallowing_laws = {
		law_sakoku
	}
	unlocking_technologies = {
		colonization
	}
	modifier = {
		state_migration_pull_unincorporated_mult = 0.5
	}
	institution = institution_colonial_affairs
	#T&R
	#TODO Pensare se forse portare divieto queste leggi solo a decolonizzazione incoraggiata
	can_enact = {
		custom_tooltip = {
			text = ztr_un_hr_conservative_decolonization_tt
			OR = {
				NOT = {
					ztr_is_un_member = yes
				}
				NOT = {
					global_var:ztr_un_hr_decolonization > 0
				}
			}
		}
	}
	#T&R
	can_impose = {
		OR = {
			AND = {
				is_in_same_power_bloc = scope:target_country
				AND = {
					modifier:country_can_impose_same_lawgroup_colonization_in_power_bloc_bool = yes
					has_law_or_variant = scope:law
				}
			}
			can_impose_law_default = yes
		}
		custom_tooltip = {
			text = ztr_un_hr_conservative_decolonization_tt
			OR = {
				NOT = {
					ztr_is_un_member = yes
				}
				NOT = {
					global_var:ztr_un_hr_decolonization > 0
				}
			}
		}
	}
	ai_will_do = {
		OR = {
			has_law_or_variant = law_type:law_colonial_exploitation
			navy_size >= 50
		}
	}
	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_taming_the_north
			}
			add = 500
		}
	}
	ai_impose_chance = {
		value = 0
		if = {
			limit = {
				OR = {
					has_law_or_variant = law_type:law_colonial_resettlement
					has_law_or_variant = law_type:law_frontier_colonization
				}
				scope:target_country = {
					has_law_or_variant = law_type:law_no_colonial_affairs
				}
				power_bloc ?= {
					has_principle_group = principle_group:principle_group_colonial_offices
				}
			}
			add = 10
		}
		if = {
			limit = {
				scope:target_country = {
					c:BIC ?= this
					OR = {
						has_journal_entry = je_british_dictate_plantations
						has_journal_entry = je_british_dictate_military
						has_journal_entry = je_british_dictate_universities
					}
				}
			}
			multiply = 0
		}
	}
}

REPLACE:law_colonial_exploitation = {
	group = lawgroup_colonization
	icon = "gfx/interface/icons/law_icons/colonial_exploitation.dds"
	progressiveness = -25
	disallowing_laws = {
		law_sakoku
	}
	unlocking_technologies = {
		colonization
	}
	modifier = {
		building_group_bg_manufacturing_unincorporated_throughput_add = -0.1
		building_group_bg_plantations_unincorporated_throughput_add = 0.2
		building_group_bg_rubber_unincorporated_throughput_add = 0.2
		building_group_bg_logging_unincorporated_throughput_add = 0.2
		building_group_bg_mining_unincorporated_throughput_add = 0.2
		state_unincorporated_starting_wages_mult = -0.1
		building_unincorporated_subsistence_output_mult = -0.1
		country_tension_decay_mult = -0.25
	}
	institution = institution_colonial_affairs
	#T&R
	can_enact = {
		custom_tooltip = {
			text = ztr_un_hr_conservative_decolonization_tt
			OR = {
				NOT = {
					ztr_is_un_member = yes
				}
				NOT = {
					global_var:ztr_un_hr_decolonization > 0
				}
			}
		}
	}
	#T&R
	can_impose = {
		OR = {
			AND = {
				is_in_same_power_bloc = scope:target_country
				AND = {
					modifier:country_can_impose_same_lawgroup_colonization_in_power_bloc_bool = yes
					has_law_or_variant = scope:law
				}
			}
			can_impose_law_default = yes
		}
		custom_tooltip = {
			text = ztr_un_hr_conservative_decolonization_tt
			OR = {
				NOT = {
					ztr_is_un_member = yes
				}
				NOT = {
					global_var:ztr_un_hr_decolonization > 0
				}
			}
		}
	}
	ai_will_do = {
		OR = {
			has_law_or_variant = law_type:law_colonial_resettlement
			navy_size >= 50
		}
	}
	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_taming_the_north
			}
			add = 500
		}
	}
	ai_impose_chance = {
		value = 0
		if = {
			limit = {
				has_law_or_variant = law_type:law_colonial_exploitation
				scope:target_country = {
					has_law_or_variant = law_type:law_no_colonial_affairs
				}
				power_bloc ?= {
					has_principle_group = principle_group:principle_group_colonial_offices
				}
			}
			add = 10
		}
		if = {
			limit = {
				scope:target_country = {
					c:BIC ?= this
					OR = {
						has_journal_entry = je_british_dictate_plantations
						has_journal_entry = je_british_dictate_military
						has_journal_entry = je_british_dictate_universities
					}
				}
			}
			multiply = 0
		}
	}
}
