﻿REPLACE:law_peasant_proprietorship = { # Homesteading for old world countries
	group = lawgroup_land_reform

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

	progressiveness = 50

	is_visible = {
		NOT = {
			has_law = law_type:law_homesteading
		}
		NOT = {
			country_is_colonial_or_company = yes
		}
		capital ?= {
			is_in_geographic_region = geographic_region_old_world
		}
		NOT = {country_has_primary_culture = cu:french}
	}

	can_enact = {
		NOT = {country_has_primary_culture = cu:french}
	}

	modifier = {
		country_farmers_pol_str_mult = 0.15
		building_group_bg_subsistence_agriculture_allowed_collectivization_add = 0.25
		building_group_bg_subsistence_ranching_allowed_collectivization_add = 0.25
		building_group_bg_agriculture_allowed_collectivization_add = 0.25
		building_group_bg_ranching_allowed_collectivization_add = 0.25
		country_financial_districts_buy_farms_likelihood = 0.25
		state_minimum_incorporated_subsistence_arable_land_add = 0.35
		#building_minimum_incorporated_subsistence_employment_add = 0.25
	}

	on_enact = {
		if = {
			limit = {
				NOR = {
					has_law_or_variant = law_type:law_commercialized_agriculture
					has_law_or_variant = law_type:law_peasant_proprietorship
				}
			}
			custom_tooltip = farmers_pb_ig_shift_effect_tt
		}
		if = {
			limit = {
				OR = {
					has_law_or_variant = law_type:law_commercialized_agriculture
					has_law_or_variant = law_type:law_collectivized_agriculture
				}
			}
			custom_tooltip = rural_laborers_tu_ig_shift_effect_negative_tt
		}
		if = {
			limit = {
				has_journal_entry = je_pedro_brazil
				NOT = { has_variable = landreform_pedropoint }
			}
			set_variable = landreform_pedropoint
			remove_pedropoint_effect = yes
		}
	}

	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_main
				has_law_or_variant = law_type:law_serfdom
			}
			add = 10000 # Top priority for Meiji AI is to get out of Serfdom
		}

		if = {
			limit = {
				NOT = {
					has_variable = is_carlist_spain
				}
				OR = {
					has_journal_entry = je_portugal_regeneration_agriculture
					has_journal_entry = je_spa_economic_regeneration_land_reform
				}
				NOT = {
					has_law = law_type:law_peasant_proprietorship
				}
			}
			add = 1000
		}

		# AI should really try to get out of Serfdom under the right circumstances
		if = {
			limit = {
				has_law_or_variant = law_type:law_serfdom
				NOT = { has_strategy = ai_strategy_reactionary_agenda }
				OR = {
					NOT = { has_strategy = ai_strategy_conservative_agenda }
					any_political_movement = {
						law_enactment_stance = {
							law = law_type:law_commercialized_agriculture
							value > neutral
						}
						political_movement_support >= 0.10
					}
				}
			}
			add = 1000
		}
	}
}

## Variants

# French

law_equal_inheritance = {
	group = lawgroup_land_reform
	parent = law_peasant_proprietorship # Inherits ideological stances from parent

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

	progressiveness = 25

	is_visible = {
		country_has_primary_culture = cu:french
	}

	can_enact = {
		country_has_primary_culture = cu:french
	}

	modifier = {
		country_farmers_pol_str_mult = 0.25
		country_peasants_pol_str_mult = 0.25
		state_farmers_investment_pool_contribution_add = 0.2
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05
		building_subsistence_output_mult = 0.15
		state_bureaucracy_population_base_cost_factor_mult = 0.1
		building_group_bg_agriculture_allowed_collectivization_add = 0.5
		building_group_bg_ranching_allowed_collectivization_add = 0.5
		state_birth_rate_mult = -0.05
		state_minimum_incorporated_subsistence_arable_land_add = 0.1
	}

	on_enact = {
		if = {
			limit = {
				NOR = {
					has_law_or_variant = law_type:law_commercialized_agriculture
					has_law_or_variant = law_type:law_peasant_proprietorship
				}
			}
			custom_tooltip = farmers_pb_ig_shift_effect_tt
		}
		if = {
			limit = {
				OR = {
					has_law_or_variant = law_type:law_commercialized_agriculture
					has_law_or_variant = law_type:law_collectivized_agriculture
				}
			}
			custom_tooltip = rural_laborers_tu_ig_shift_effect_negative_tt
		}
		if = {
			limit = {
				has_journal_entry = je_pedro_brazil
				NOT = { has_variable = landreform_pedropoint }
			}
			set_variable = landreform_pedropoint
			remove_pedropoint_effect = yes
		}
	}

	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_main
				has_law_or_variant = law_type:law_serfdom
			}
			add = 10000 # Top priority for Meiji AI is to get out of Serfdom
		}

		if = {
			limit = {
				NOT = {
					has_variable = is_carlist_spain
				}
				OR = {
					has_journal_entry = je_portugal_regeneration_agriculture
					has_journal_entry = je_spa_economic_regeneration_land_reform
				}
				NOT = {
					has_law = law_type:law_peasant_proprietorship
				}
			}
			add = 1000
		}

		# AI should really try to get out of Serfdom under the right circumstances
		if = {
			limit = {
				has_law_or_variant = law_type:law_serfdom
				NOT = { has_strategy = ai_strategy_reactionary_agenda }
				OR = {
					NOT = { has_strategy = ai_strategy_conservative_agenda }
					any_political_movement = {
						law_enactment_stance = {
							law = law_type:law_commercialized_agriculture
							value > neutral
						}
						political_movement_support >= 0.10
					}
				}
			}
			add = 1000
		}
	}
}
