
ARM_worsen_corruption = {
	hidden_effect = {
		random_list = {
			10 = {
				modifier = {
					factor = 0.5
					check_variable = {ARM_consumer_goods_expected_value > 0.1}
				}
				add_to_variable = {ARM_consumer_goods_expected_value = 0.02 }
			}
			10 = {
				modifier = {
					factor = 0.5
					check_variable = {ARM_research_speed_factor < -0.1}
				}
				add_to_variable = {ARM_research_speed_factor = -0.05 }
			}
			10 = {
				modifier = {
					factor = 0.5
					check_variable = {ARM_enemy_army_bonus_air_superiority_factor < -0.1}
				}
				add_to_variable = {ARM_enemy_army_bonus_air_superiority_factor = -0.05 }
			}
			10 = {
				modifier = {
					factor = 0.5
					check_variable = {ARM_political_power_gain < -0.14}
				}
				add_to_variable = {ARM_political_power_gain = -0.05 }
			}
			10 = {
				modifier = {
					factor = 0.5
					check_variable = {ARM_production_speed_industrial_complex_factor < -0.15}
				}
				add_to_variable = {ARM_production_speed_industrial_complex_factor = -0.05 }
			}
		}
	}
}
ARM_reduce_corruption = {
	hidden_effect = {
		random_list = {
			10 = {
				modifier = {
					factor = 0
					check_variable = {ARM_consumer_goods_expected_value < 0.01}
				}
				add_to_variable = {ARM_consumer_goods_expected_value = -0.02 }
			}
			10 = {
				modifier = {
					factor = 0
					check_variable = {ARM_research_speed_factor > -0.01}
				}
				add_to_variable = {ARM_research_speed_factor = 0.05 }
			}
			10 = {
				modifier = {
					factor = 0
					check_variable = {ARM_enemy_army_bonus_air_superiority_factor > -0.01}
				}
				add_to_variable = {ARM_enemy_army_bonus_air_superiority_factor = 0.05 }
			}
			10 = {
				modifier = {
					factor = 0
					check_variable = {ARM_political_power_gain > -0.01}
				}
				add_to_variable = {ARM_political_power_gain = 0.05 }
			}
			10 = {
				modifier = {
					factor = 0
					check_variable = {ARM_production_speed_industrial_complex_factor > -0.01}
				}
				add_to_variable = {ARM_production_speed_industrial_complex_factor = 0.05 }
			}
		}
	}
}
armenian_add_dem = {
	for_each_loop = {
		array = armenian_state_map
		value = v
		break = break
		if = {
			limit = {
				NOT = {check_variable = { v = 4 }}
			}
			set_variable = { armenian_state_map^v = 4 }
			set_temp_variable = { break = 1 }
			armenian_recalc_control = yes
		}
	}
}
armenian_add_koch_control = {
	for_each_loop = {
		array = armenian_state_map
		value = v
		break = break
		if = {
			limit = {
				NOT = {check_variable = { v = 3 }}
			}
			set_variable = { armenian_state_map^v = 3 }
			set_temp_variable = { break = 1 }
			armenian_recalc_control = yes
		}
	}
}
armenian_recalc_control = {
	set_variable = { ARM_military_control = 0 }
	set_variable = { ARM_democratic_control = 0 }
	set_variable = { ARM_sarksian_control = 0 }
	set_variable = { ARM_koch_control = 0 }
	set_variable = { ARM_independent_control = 0 }
	for_each_loop = {
		array = armenian_state_map
		value = v
		break = break
		if = {
			limit = {
				check_variable = { v = 1 }
			}
			add_to_variable = {
				var = ARM_independent_control
				value = 1
			}
		}
		if = {
			limit = {
				check_variable = { v = 4 }
			}
			add_to_variable = {
				var = ARM_democratic_control
				value = 1
			}
		}
		if = {
			limit = {
				check_variable = { v = 2 }
			}
			add_to_variable = {
				var = ARM_sarksian_control
				value = 1
			}
		}
		if = {
			limit = {
				check_variable = { v = 3 }
			}
			add_to_variable = {
				var = ARM_koch_control
				value = 1
			}
		}
		if = {
			limit = {
				check_variable = { v = 5 }
			}
			add_to_variable = {
				var = ARM_military_control
				value = 1
			}
		}
	}
	if = {
		limit = {
			has_completed_focus = ARM_sarksian_struggle
		}
		set_variable = {ARM_stab_factor = ARM_sarksian_control}
		add_to_variable = {
			var = ARM_stab_factor
			value = -5
		}
		multiply_variable = { ARM_stab_factor = 2 }
		set_variable = {ARM_stab_factor_vis = ARM_stab_factor}
		divide_variable = { ARM_stab_factor = 100 }
	}
	else_if = {
		limit = {
			has_completed_focus = ARM_reject_the_mafia
		}
		set_variable = {ARM_stab_factor = ARM_independent_control}
		add_to_variable = {
			var = ARM_stab_factor
			value = -5
		}
		multiply_variable = { ARM_stab_factor = 2 }
		set_variable = {ARM_stab_factor_vis = ARM_stab_factor}
		divide_variable = { ARM_stab_factor = 100 }
	}
	else_if = {
		limit = {
			has_completed_focus = ARM_launch_the_coup
		}
		set_variable = {ARM_stab_factor = ARM_independent_control}
		add_to_variable = {
			var = ARM_stab_factor
			value = -5
		}
		multiply_variable = { ARM_stab_factor = 2 }
		set_variable = {ARM_stab_factor_vis = ARM_stab_factor}
		divide_variable = { ARM_stab_factor = 100 }
	}
	else = {
		set_variable = {ARM_stab_factor = ARM_koch_control}
		add_to_variable = {
			var = ARM_stab_factor
			value = -5
		}
		multiply_variable = { ARM_stab_factor = 2 }
		set_variable = {ARM_stab_factor_vis = ARM_stab_factor}
		divide_variable = { ARM_stab_factor = 100 }
	}
}
