﻿law_peasant_levies = {
	group = lawgroup_army_model
	icon = "gfx/interface/icons/law_icons/peasant_levies.dds"
	
	progressiveness = -50
	
	modifier = {
		state_conscription_rate_add = 0.02
		country_aristocrats_pol_str_mult = 0.25
		state_building_barracks_max_level_add = 25
		state_building_conscription_center_max_level_add = 100
		building_mobilization_cost_mult = -0.1
	}
	
	can_impose = {
		OR = {
			AND = {
				is_in_same_power_bloc = scope:target_country
				AND = {
					modifier:country_can_impose_same_lawgroup_army_model_in_power_bloc_bool = yes
					has_law = scope:law
				}
			}
			can_impose_law_default = yes
		}
	}
	
	on_enact = {
		custom_tooltip = QUALIFICATIONS_OFFICERS_PEASANT_LEVIES_DESC
		if = {
			limit = {
				NOT = {
					has_law = law_type:law_peasant_levies
				}
			}
			custom_tooltip = aristocrats_af_ig_shift_effect_tt
		}
		if = {
			limit = {
				has_law = law_type:law_professional_army
			}
			custom_tooltip = military_pops_af_ig_shift_effect_negative_tt
			custom_tooltip = non_military_pops_af_ig_shift_effect_negative_tt
		}
	}

	# AI will never return to peasant levies
	ai_will_do = {
		always = no
	}

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

law_professional_army = {
	group = lawgroup_army_model
	icon = "gfx/interface/icons/law_icons/professional_army.dds"
	
	progressiveness = 0
	
	unlocking_technologies = { military_drill }
	
	modifier = {
		state_conscription_rate_add = 0.02
		country_officers_pol_str_mult = 0.25
		state_building_barracks_max_level_add = 200
		state_building_conscription_center_max_level_add = 100
		unit_experience_gain_add = 1
	}
	
	can_impose = {
		OR = {
			AND = {
				is_in_same_power_bloc = scope:target_country
				AND = {
					modifier:country_can_impose_same_lawgroup_army_model_in_power_bloc_bool = yes
					has_law = scope:law
				}
			}
			can_impose_law_default = yes
		}
	}
	
	on_enact = {
		if = {
			limit = {
				has_law = law_type:law_peasant_levies
			}
			custom_tooltip = aristocrats_af_ig_shift_effect_negative_tt
		}
		if = {
			limit = {
				NOT = {
					has_law = law_type:law_professional_army
				}
			}
			custom_tooltip = non_military_pops_af_ig_shift_effect_tt
			custom_tooltip = military_pops_af_ig_shift_effect_tt
		}
	}

	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_sick_man_army
				has_law = law_type:law_peasant_levies
			}
			add = 1000
		}			
		
		# AI should really try to get out of Peasant Levies under the right circumstances
		if = {
			limit = {
				has_law = law_type:law_peasant_levies
				NOT = { has_strategy = ai_strategy_reactionary_agenda }
				OR = {
					NOT = { has_strategy = ai_strategy_conservative_agenda }
					any_political_movement = {
						law_stance = {
							law = law_type:law_professional_army 
							value > neutral
						}	
						political_movement_support >= 0.10
					}
					has_technology_researched = napoleonic_warfare
				}	
			}
			add = 1000
		}		
	}
}

law_national_militia = {
	group = lawgroup_army_model
	icon = "gfx/interface/icons/law_icons/national_militia.dds"
	
	progressiveness = 0
	
	unlocking_technologies = { mandatory_service }
	
	modifier = {
		state_conscription_rate_add = 0.04
		state_building_barracks_max_level_add = 25
		state_building_conscription_center_max_level_add = 100
		building_training_rate_mult = 0.2
		unit_experience_gain_add = 1
	}
	
	can_enact = {
		OR = {
			is_power_bloc_leader = no
			power_bloc ?= {
				NOT = { has_identity = identity:identity_military_treaty_organization }
			}
		}
	}
	
	on_enact = {
		if = {
			limit = {
				has_law = law_type:law_peasant_levies
			}
			custom_tooltip = aristocrats_af_ig_shift_effect_negative_tt
		}
		if = {
			limit = {
				has_law = law_type:law_professional_army
			}
			custom_tooltip = military_pops_af_ig_shift_effect_negative_tt
			custom_tooltip = non_military_pops_af_ig_shift_effect_negative_tt
		}
	}
	
	ai_will_do = {
		exists = ruler
		ruler = {
			has_ideology = ideology:ideology_pacifist
		}
	}

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

law_mass_conscription = {
	group = lawgroup_army_model
	icon = "gfx/interface/icons/law_icons/mass_conscription.dds"
	
	progressiveness = 50
	
	unlocking_technologies = { enlistment_offices }
	
	modifier = {
		state_conscription_rate_add = 0.04
		state_building_barracks_max_level_add = 200
		state_building_conscription_center_max_level_add = 100
	}

	can_impose = {
		OR = {
			AND = {
				is_in_same_power_bloc = scope:target_country
				AND = {
					modifier:country_can_impose_same_lawgroup_army_model_in_power_bloc_bool = yes
					has_law = scope:law
				}
			}
			can_impose_law_default = yes
		}
	}
	
	on_enact = {
		if = {
			limit = {
				has_law = law_type:law_peasant_levies
			}
			custom_tooltip = aristocrats_af_ig_shift_effect_negative_tt
		}
		if = {
			limit = {
				has_law = law_type:law_professional_army
			}
			custom_tooltip = military_pops_af_ig_shift_effect_negative_tt
			custom_tooltip = non_military_pops_af_ig_shift_effect_negative_tt
		}
	}

	ai_enact_weight_modifier = { #Petitions
		value = 0
		
		if = {
			limit = { ai_has_enact_weight_modifier_journal_entries = yes }
			add = 750
		}
		
		if = {
			limit = { 
				OR = {
					has_journal_entry = je_sick_man_army
					has_journal_entry = je_great_reforms_military
				}
				has_law = law_type:law_peasant_levies
			}
			add = 1000
		}			
		
		# AI should really try to get out of Peasant Levies under the right circumstances
		if = {
			limit = {
				has_law = law_type:law_peasant_levies
				NOT = { has_strategy = ai_strategy_reactionary_agenda }
				OR = {
					NOT = { has_strategy = ai_strategy_conservative_agenda }
					any_political_movement = {
						law_stance = {
							law = law_type:law_mass_conscription
							value > neutral
						}	
						political_movement_support >= 0.10
					}
					has_technology_researched = napoleonic_warfare
				}	
			}
			add = 1000
		}		
	}
}
