wrs_hunger_category = {

	#Высчитывание ежемесячного прироста. Боже, да я просто какой то математик

	wrs_monthly_hunger_progress = {
	
		icon = POL_looming_peasants_strike
	
		available = {
			custom_trigger_tooltip = {
				tooltip = wrs_hunger_is_done
				has_country_flag = wrs_hunger_is_done
			}
		}
		
		activation = {
			WRS = {
				has_country_flag = wrs_has_hunger
			}
		}
	
		priority = 125
		
		is_good = no
		
		days_mission_timeout = 30
		
		days_re_enable = 0
		
		fire_only_once = no
		
		cancel_trigger = {
			NOT = { has_country_flag = wrs_has_hunger }
		}
		
		timeout_effect = {

		#Высчитывание населения
			set_variable = { 
				ROOT.total_pop = 0 
			}
			hidden_effect = {
				every_owned_state = {
					add_to_variable = { ROOT.total_pop = state_population_k }
				}
			}
			set_variable = {
				wrs_manpower_current = ROOT.total_pop
			}
			multiply_variable = {
				wrs_manpower_current = -0.5
			}

			#Высчитывание колхозов
			if = {
				limit = {
					NOT = {
						has_country_flag = wrs_invented_sovhoz
					}
					NOT = {
						has_country_flag = wrs_invented_garnizon
					}
				}
				set_variable = { wrs_hunger_production_plus = wrs_hunger_current_kolhoz }
				multiply_variable = { wrs_hunger_production_plus = 1 }
			}
			#Совхозы
			else_if = {
				limit = {
					has_country_flag = wrs_invented_sovhoz
				}
				set_variable = { wrs_hunger_production_plus = wrs_hunger_current_kolhoz }
				multiply_variable = { wrs_hunger_production_plus = 2 }
			}
			#Гарнизоны
			else = {
				set_variable = { wrs_hunger_production_plus = wrs_hunger_current_kolhoz }
				multiply_variable = { wrs_hunger_production_plus = 3 }
			}

		#Прибывшие беженцы
			set_variable = { wrs_hunger_monthly_refugees = random }
			multiply_variable = { wrs_hunger_monthly_refugees = 50000 }
			hidden_effect = {
				add_manpower = var:wrs_hunger_monthly_refugees
			}
			set_variable = { wrs_hunger_new_mouthes = var:wrs_hunger_monthly_refugees}
			multiply_variable = {
				wrs_hunger_new_mouthes = -0.05
			}

		#Траты (получение) припасов в месяц
			set_variable = { wrs_hunger_monthly_ammun = 0 }
			add_to_variable = { wrs_hunger_monthly_ammun = var:wrs_manpower_current }
			add_to_variable = { wrs_hunger_monthly_ammun = var:wrs_hunger_new_mouthes }
			add_to_variable = { wrs_hunger_monthly_ammun = var:wrs_hunger_production_plus }

		add_to_variable = {
			wrs_hunger_current_ammun = var:wrs_hunger_monthly_ammun
		}
		WRS_hunger_progressbar_var = yes
		
		if = {
			limit = {
				is_ai = no
				check_variable = { wrs_hunger_current_ammun < 0 }
				
				NOT = { has_country_flag = WRS_hunger_chance }
			}
			hidden_effect = {
				country_event = wrs.50
			}
		}
		
		else_if = {
			limit = {
				is_ai = no
				check_variable = { wrs_hunger_current_ammun < 0 }
				
				has_country_flag = WRS_hunger_chance
			}
			hidden_effect = {
				country_event = wrs.51
			}
		}
		
		else = {
			add_political_power = -1
		}
		
		activate_mission = wrs_monthly_hunger_progress
		}
	
	}

	wrs_hunger_economy_army = {
	
		priority = 25

		icon = eng_propaganda_campaigns
		cost = 25
		allowed = {
			original_tag = WRS
		}
		
		visible = {
			has_country_flag = wrs_has_hunger
		}

		fire_only_once = no
		
		ai_will_do = {
			factor = 50
		}

		remove_effect = {
			custom_effect_tooltip = wrs_ammun_plus_1000
			add_to_variable = {
				wrs_hunger_current_ammun = 1000
			}
			add_timed_idea = {
				idea = wrs_hunger_minus_army
				days = 30
			}
		}
		days_remove = 10

		days_re_enable = 20
	}

	wrs_hunger_card_system = {
	
		priority = 15

		icon = eng_propaganda_campaigns
		cost = 20
		allowed = {
			original_tag = WRS
		}
		
		visible = {
			has_country_flag = wrs_has_hunger
		}

		available = {
			has_completed_focus = WRS_voroshilov_social_rationing
		}

		fire_only_once = no
		
		ai_will_do = {
			factor = 50
		}

		complete_effect = {
			add_political_power = -15
			add_stability = -0.1
		}

		remove_effect = {
			custom_effect_tooltip = wrs_ammun_plus_3000
			add_to_variable = {
				wrs_hunger_current_ammun = 3000
			}
		}
		days_remove = 10

		days_re_enable = 15
	}

	wrs_hunger_zhukov_propaganda = {
	
		priority = 14

		icon = eng_propaganda_campaigns
		cost = 10
		allowed = {
			original_tag = WRS
		}
		
		visible = {
			has_country_flag = wrs_has_hunger
		}

		available = {
			has_completed_focus = WRS_intro_zhukov_propaganda_drive
		}

		fire_only_once = no
		
		ai_will_do = {
			factor = 50
		}

		complete_effect = {
			add_stability = 0.01
		}

		remove_effect = {
			custom_effect_tooltip = wrs_ammun_plus_3000
			add_to_variable = {
				wrs_hunger_current_ammun = 3000
			}
		}
		days_remove = 15

		days_re_enable = 20
	}

	wrs_hunger_rekvizition = {
	
		priority = 50

		icon = eng_propaganda_campaigns
		cost = 30
		allowed = {
			original_tag = WRS
		}
		
		visible = {
			has_country_flag = wrs_has_hunger
		}

		fire_only_once = no
		
		ai_will_do = {
			factor = 50
		}

		complete_effect = {
			add_stability = -0.05
			add_political_power = -10
		}

		remove_effect = {
			custom_effect_tooltip = wrs_ammun_plus_1000
			add_to_variable = {
				wrs_hunger_current_ammun = 1000
			}
		}
		days_remove = 20

		days_re_enable = 5
	}

	wrs_hunger_mobilize = {
	
		priority = 40

		icon = eng_propaganda_campaigns
		cost = 50
		allowed = {
			original_tag = WRS
		}
		
		visible = {
			has_country_flag = wrs_has_hunger
		}

		fire_only_once = no
		
		ai_will_do = {
			factor = 50
		}

		complete_effect = {

		}

		remove_effect = {
			add_manpower = -1500
			custom_effect_tooltip = wrs_ammun_plus_3000
			add_to_variable = {
				wrs_hunger_current_ammun = 3000
			}
		}
		days_remove = 15

		days_re_enable = 5
	}

	wrs_hunger_increase_kolkozhes = {
	
		priority = 30

		icon = eng_propaganda_campaigns
		cost = 50
		allowed = {
			original_tag = WRS
		}
		
		visible = {
			has_country_flag = wrs_has_hunger
		}

		fire_only_once = no
		
		ai_will_do = {
			factor = 50
		}

		complete_effect = {

		}

		remove_effect = {
			add_to_variable = { wrs_hunger_current_kolhoz = 100 } 
		    custom_effect_tooltip = wrs_kolkhoz_plus
			custom_effect_tooltip = wrs_ammun_minus_1000
			add_to_variable = {
				wrs_hunger_current_ammun = -1000
			}
		}
		days_remove = 30

		days_re_enable = 5
	}

}