﻿# 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_mercantilism = {
	group = lawgroup_trade_policy

	icon = "gfx/interface/icons/law_icons/mercantilism.dds"

	progressiveness = 0

	unlocking_technologies = {
		international_trade
	}

	modifier = {
		state_tariff_import_add = 0.50
		state_tariff_export_add = 0.20
		state_subvention_export_add = 0.50
		state_subvention_import_add = 0.20
		state_import_advantage_mult = -0.25
		state_export_advantage_mult = 0.25
	}

	# Don't change back to mercantilism once we have protectionism or free trade
	ai_will_do = {
		NOR = {
			has_law = law_type:law_protectionism
			has_law = law_type:law_free_trade
		}
	}

	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_isolationism
			}
			add = 1000
		}
	}
}

law_protectionism = {
	group = lawgroup_trade_policy

	icon = "gfx/interface/icons/law_icons/protectionism.dds"

	progressiveness = 50

	unlocking_technologies = {
		stock_exchange
	}

	modifier = {
		state_tariff_import_add = 0.50
		state_tariff_export_add = 0.50
		state_subvention_export_add = 0.50
		state_subvention_import_add = 0.50
		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
		}

		if = {
			limit = {
				has_journal_entry = je_meiji_diplomacy
				has_law = law_type:law_isolationism
			}
			add = 1000
		}
	}
}

law_free_trade = {
	group = lawgroup_trade_policy

	icon = "gfx/interface/icons/law_icons/free_trade.dds"

	progressiveness = 50

	disallowing_laws = {
		law_command_economy
	}

	unlocking_technologies = {
		international_trade
	}

	on_enact = {
		if = {
			limit = { is_banning_goods = g:opium }
			remove_banned_goods = g:opium
		}
		if = {
			limit = { is_banning_goods = g:liquor }
			remove_banned_goods = g:liquor
		}
	}

	modifier = {
		state_subvention_export_add = 0.50
		state_subvention_import_add = 0.50
		state_trade_advantage_mult = 0.25
		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
		}

		if = {
			limit = {
				has_journal_entry = je_meiji_diplomacy
				has_law = law_type:law_isolationism
			}
			add = 1000
		}
	}
}

law_isolationism = {
	group = lawgroup_trade_policy

	icon = "gfx/interface/icons/law_icons/isolationism.dds"

	progressiveness = -50

	disallowing_laws = {
		law_laissez_faire
	}

	is_visible = {
		NAND = {
			any_primary_culture = {
				has_discrimination_trait = han_chinese
			}
			any_scope_state = {
				state_region = s:STATE_GUANGDONG
				is_largest_state_in_region = yes
			}
		}
	}

	can_enact = {
		is_in_power_bloc = no
		hidden_trigger = {
			NAND = {
				any_primary_culture = {
					has_discrimination_trait = han_chinese
				}
				any_scope_state = {
					state_region = s:STATE_GUANGDONG
					is_largest_state_in_region = yes
				}
			}
		}
	}

	modifier = {
		country_authority_mult = 0.5
		state_tax_capacity_mult = 0.25
		country_tech_spread_mult = -0.15

		country_leverage_resistance_mult = 1.0

		country_max_declared_interests_mult = -0.5

		country_disallow_trade_bool = yes
	}

	ai_will_do = {
		OR = {
			has_journal_entry = je_gyojo_shinwon
			ruler = {
				OR = {
					has_ideology = ideology:ideology_traditionalist
					has_ideology = ideology:ideology_vanguardist
				}
			}
		}
	}

	ai_enact_weight_modifier = { #Petitions
		value = 0

		if = {
			limit = { ai_has_enact_weight_modifier_journal_entries = yes }
			add = 750
		}
	}
}

# Special isolationism variant for China, allows TCs to be built only in Western Guangdong
law_canton_system = {
	group = lawgroup_trade_policy
	parent = law_isolationism # Inherits ideological stances from parent

	icon = "gfx/interface/icons/law_icons/isolationism.dds"

	progressiveness = -50

	requires_law_or = {
		law_traditionalism
	}

	is_visible = {
		any_primary_culture = {
			has_discrimination_trait = han_chinese
		}
		any_scope_state = {
			state_region = s:STATE_GUANGDONG
			is_largest_state_in_region = yes
		}
	}

	can_enact = {
		is_in_power_bloc = no
		any_primary_culture = {
			has_discrimination_trait = han_chinese
		}
		any_scope_state = {
			state_region = s:STATE_GUANGDONG
			is_largest_state_in_region = yes
		}
	}

	modifier = {
		country_authority_mult = 0.25
		state_tax_capacity_mult = 0.15
		country_tech_spread_mult = -0.10
		state_trade_capacity_mult = -0.5
		state_tariff_import_add = 0.50
		state_tariff_export_add = 0.50
		state_subvention_export_add = 0.20
		state_subvention_import_add = 0.20

		country_leverage_resistance_mult = 0.75

		country_max_declared_interests_mult = -0.33

		country_disallow_trade_outside_canton_bool = yes
	}

	ai_will_do = {
		OR = {
			has_journal_entry = je_gyojo_shinwon
			ruler = {
				OR = {
					has_ideology = ideology:ideology_traditionalist
					has_ideology = ideology:ideology_vanguardist
				}
			}
		}
	}

	ai_enact_weight_modifier = { #Petitions
		value = 0

		if = {
			limit = { ai_has_enact_weight_modifier_journal_entries = yes }
			add = 750
		}
	}
}
