scavenge_pa_start = {
	if = {
		limit = {
			has_tech = wasteland_pa_tech
			NOT = { has_tech = scav_pa_tech }
			NOT = { has_tech = power_armour_enclave_1 }
			NOT = { has_tech = power_armour_enclave_2 }
		}
		add_equipment_to_stockpile = { type = power_armor_equipment_1 amount = -50 }
		set_country_flag = scavenged_pa_1
	}
	if = {
		limit = {
			has_tech = scav_pa_tech
			NOT = { has_tech = t45d_pa_tech }
			NOT = { has_tech = power_armour_enclave_1 }
			NOT = { has_tech = power_armour_enclave_2 }
		}
		add_equipment_to_stockpile = { type = power_armor_equipment_2 amount = -50 }
		set_country_flag = scavenged_pa_2
	}
	if = {
		limit = {
			has_tech = t45d_pa_tech
			NOT = { has_tech = t51b_pa_tech }
			NOT = { has_tech = power_armour_enclave_1 }
			NOT = { has_tech = power_armour_enclave_2 }
		}
		add_equipment_to_stockpile = { type = power_armor_equipment_3 amount = -50 }
		set_country_flag = scavenged_pa_3
	}
	if = {
		limit = {
			has_tech = t51b_pa_tech
			NOT = { has_tech = power_armour_enclave_1 }
			NOT = { has_tech = power_armour_enclave_2 }
		}
		add_equipment_to_stockpile = { type = power_armor_equipment_4 amount = -50 }
		set_country_flag = scavenged_pa_4
	}
	if = {
		limit = {
			has_tech = power_armour_enclave_1
			NOT = { has_tech = power_armour_enclave_2 }
		}
		add_equipment_to_stockpile = { type = enclave_power_armour_equipment_1 amount = -50 }
		set_country_flag = scavenged_enclave_pa_1
	}
	if = {
		limit = {
			has_tech = power_armour_enclave_2
		}
		add_equipment_to_stockpile = { type = enclave_power_armour_equipment_2 amount = -50 }
		set_country_flag = scavenged_enclave_pa_2
	}
}
scavenge_pa_end = {
	if = {
		limit = { check_variable = { resolve_rng < 0.5 } }
		add_manpower = 50
		if = {
			limit = {
				has_country_flag = scavenged_pa_1
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_1 amount = 50 }
			clr_country_flag = scavenged_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_2
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_2 amount = 50 }
			clr_country_flag = scavenged_pa_2
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_3
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_3 amount = 50 }
			clr_country_flag = scavenged_pa_3
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_4
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_4 amount = 50 }
			clr_country_flag = scavenged_pa_4
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_1
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_1 amount = 50 }
			clr_country_flag = scavenged_enclave_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_2
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_2 amount = 50 }
			clr_country_flag = scavenged_enclave_pa_2
		}
	}
	else_if = {
		limit = { check_variable = { resolve_rng < 0.7 } }
		add_manpower = 47
		if = {
			limit = {
				has_country_flag = scavenged_pa_1
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_1 amount = 47 }
			clr_country_flag = scavenged_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_2
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_2 amount = 47 }
			clr_country_flag = scavenged_pa_2
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_3
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_3 amount = 47 }
			clr_country_flag = scavenged_pa_3
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_4
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_4 amount = 47 }
			clr_country_flag = scavenged_pa_4
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_1
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_1 amount = 47 }
			clr_country_flag = scavenged_enclave_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_2
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_2 amount = 47 }
			clr_country_flag = scavenged_enclave_pa_2
		}
	}
	else_if = {
		limit = { check_variable = { resolve_rng < 0.9 } }
		add_manpower = 45
		if = {
			limit = {
				has_country_flag = scavenged_pa_1
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_1 amount = 45 }
			clr_country_flag = scavenged_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_2
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_2 amount = 45 }
			clr_country_flag = scavenged_pa_2
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_3
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_3 amount = 45 }
			clr_country_flag = scavenged_pa_3
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_4
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_4 amount = 45 }
			clr_country_flag = scavenged_pa_4
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_1
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_1 amount = 45 }
			clr_country_flag = scavenged_enclave_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_2
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_2 amount = 45 }
			clr_country_flag = scavenged_enclave_pa_2
		}
	}
	else = {
		add_manpower = 42
		if = {
			limit = {
				has_country_flag = scavenged_pa_1
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_1 amount = 42 }
			clr_country_flag = scavenged_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_2
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_2 amount = 42 }
			clr_country_flag = scavenged_pa_2
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_3
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_3 amount = 42 }
			clr_country_flag = scavenged_pa_3
		}
		if = {
			limit = {
				has_country_flag = scavenged_pa_4
			}
			add_equipment_to_stockpile = { type = power_armor_equipment_4 amount = 42 }
			clr_country_flag = scavenged_pa_4
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_1
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_1 amount = 42 }
			clr_country_flag = scavenged_enclave_pa_1
		}
		if = {
			limit = {
				has_country_flag = scavenged_enclave_pa_2
			}
			add_equipment_to_stockpile = { type = enclave_power_armour_equipment_2 amount = 42 }
			clr_country_flag = scavenged_enclave_pa_2
		}
	}
}