on_actions = {

	
    on_weekly = {
		effect = {	




			set_temp_variable = { temp_warexhaustion_1 = max_manpower_k }
				divide_temp_variable = { temp_warexhaustion_1 = 450 }

			set_temp_variable = { temp_warexhaustion_2 = max_manpower_k }
				divide_temp_variable = { temp_warexhaustion_2 = 400 }

			set_temp_variable = { temp_warexhaustion_3 = max_manpower_k }
				divide_temp_variable = { temp_warexhaustion_3 = 375 }

			set_temp_variable = { temp_warexhaustion_4 = max_manpower_k }
				divide_temp_variable = { temp_warexhaustion_4 = 325 }

			set_temp_variable = { temp_warexhaustion_5 = max_manpower_k }
				divide_temp_variable = { temp_warexhaustion_5 = 250 }



			if = { 
				limit = { check_variable = { temp_warexhaustion_1 < casualties_k }
						 }
					add_to_variable = { exhaustion = 0.03 }
					}



			
			if = { 
				limit = { check_variable = { temp_warexhaustion_2 < casualties_k }
						 }
					add_to_variable = { exhaustion = 0.08 }
					}


			if = { 
				limit = { check_variable = { temp_warexhaustion_3 < casualties_k }
						 }
					add_to_variable = { exhaustion = 0.16 }
					}

					
			if = { 
				limit = { check_variable = { temp_warexhaustion_4 < casualties_k }
						 }
					add_to_variable = { exhaustion = 0.20 }
					}


			if = { 
				limit = { check_variable = { temp_warexhaustion_5 < casualties_k }
						 }
					add_to_variable = { exhaustion = 0.28 }
					}



			
			if = { 
				limit = { surrender_progress > 0.25
						 }
					add_to_variable = { exhaustion = 0.01 }
					}
	
			if = { 
				limit = { surrender_progress > 0.5
						 }
					add_to_variable = { exhaustion = 0.08 }
					}

		
			if = { 
				limit = { surrender_progress > 0.8
						 }
					add_to_variable = { exhaustion = 0.16 }
					}
	


			add_to_variable = { warex_view = exhaustion }
			clear_variable = exhaustion
			clamp_variable = {
				var = warex_view
				min = 0
				max = 10
			}
			
		}
	}
				
}