# group = this is the law_group a law belongs to
# icon = graphical icon shown in-game
# modifier = {} modifier on country for having adopted this law

law_slavery_banned = {
	group = lawgroup_slavery
	
	progressiveness = 100
	
	icon = "gfx/interface/icons/law_icons/slavery_banned.dds"
	
	on_activate = {
		custom_tooltip = {
			text = liberate_slaves_tt
			liberate_slaves = yes
		}
		set_variable = {
			name = slavery_forget
			value = yes
			days = 1095
		}
	}
	
	modifier = {
	}
	
	pop_support = {
		value = 0
		
		add = {
			desc = "POP_SLAVES"
			if = {
				limit = { 
					is_pop_type = slaves
				}
				value = 1
			}
		}	
		add = {
			desc = "POP_ACADEMICS"
			if = {
				limit = {
					is_pop_type = academics
				}
				value = 0.1
			}
		}
		add = {
			desc = "POP_CLERGYMEN"
			if = {
				limit = {
					is_pop_type = clergymen
				}
				value = 0.05
			}
		}
	}
	
	revolution_state_weight = {
		value = 1
		if = {
		   limit = { is_slave_state = yes }
		   #if = {
		   #   limit = { owner = { has_journal_entry = je_acw_countdown } }	  
			#  multiply = 0.0
		   #}
		   #else = {
			  multiply = 0.25
		   #}	
		}	
	}
}

law_debt_slavery = {
	group = lawgroup_slavery
	
	progressiveness = 0
	
	icon = "gfx/interface/icons/law_icons/debt_slavery.dds"
	
	disallowing_laws = {
		law_multicultural
	}

	on_enact = {
		ig:ig_landowners = { add_ideology = ideology_pro_slavery }
	}
	
	modifier = {
	}
	
	pop_support = {
		value = 0
		
		add = {
			desc = "POP_SLAVES"
			if = {
				limit = { 
					is_pop_type = slaves
				}
				value = 1
			}
		}	
		add = {
			desc = "POP_ACADEMICS"
			if = {
				limit = {
					is_pop_type = academics
				}
				value = 0.1
			}
		}
		add = {
			desc = "POP_CLERGYMEN"
			if = {
				limit = {
					is_pop_type = clergymen
				}
				value = 0.05
			}
		}
	}
	
	possible_political_movements = {
		law_slavery_banned
		law_legacy_slavery
	}
	
	# AI should never enact debt slavery
	ai_will_do = {
		always = no
	}
}

law_slave_trade = {
	group = lawgroup_slavery
	
	progressiveness = 0
	
	icon = "gfx/interface/icons/law_icons/slave_trade.dds"
	
	disallowing_laws = {
		law_cultural_exclusion
		law_multicultural
	}
	
	on_enact = {
		ig:ig_landowners = { add_ideology = ideology_pro_slavery }
	}
	
	modifier = {
		interest_group_ig_landowners_pol_str_mult = 0.5
	}
	
	possible_political_movements = {
		law_slavery_banned
		law_legacy_slavery
	}

	pop_support = {
		value = 0
		
		add = {
			desc = "POP_ARISTOCRATS"
			if = {
				limit = { 
					is_pop_type = aristocrats
				}
				value = 0.1
			}
		}
	}
	
	ai_will_do = {
		exists = ruler
		ruler = {
			has_ideology = ideology_slaver
		}
	}
	
	revolution_state_weight = {
		value = 1
		if = {
		   limit = { is_slave_state = yes }
		   multiply = 2
		}
		else = {
		    #if = {
		    #  limit = { owner = { has_journal_entry = je_acw_countdown } }	  
			#  multiply = 0.0
		   #}
		   #else = {
			  multiply = 0.25
		   #
		}
	}
}

law_legacy_slavery = {
	group = lawgroup_slavery
	
	progressiveness = 50
	
	icon = "gfx/interface/icons/law_icons/legacy_slavery.dds"

	# no need to add disallowing_laws here since it can only be enacted from Slave Trade
	
	unlocking_laws = {
		law_slave_trade
	}
	
	modifier = {
		interest_group_ig_landowners_pol_str_mult = 0.25
	}
	
	possible_political_movements = {
		law_slavery_banned
	}
	
	pop_support = {
		value = 0
		add = {
			desc = "POP_ACADEMICS"
			if = {
				limit = {
					is_pop_type = academics
				}
				value = 0.1
			}
		}
		add = {
			desc = "POP_CLERGYMEN"
			if = {
				limit = {
					is_pop_type = clergymen
				}
				value = 0.05
			}
		}
	}

	revolution_state_weight = {
		value = 1
		if = {
		   limit = { is_slave_state = no }
		   multiply = 0.001
		}
	}
}