﻿add_namespace = resource_production
country_event = {#not enough iron or coal to produce steel, close a steel mill
	id = resource_production.1 
	title = resource_production.1.t
	desc = resource_production.1.d 

	picture = GFX_report_event_election_vote

	trigger = {
		any_owned_state={
			steel_mill > 0
		}
		OR={
			check_variable = { resource@iron < 0}
			check_variable = { resource@coal < 0}
		}
	}

	mean_time_to_happen = {
		days = 20
		#modifier = {
		#	factor = 10 # If true multiply 20 by 10 = 200
		#	is_ai = yes
		#}
	}

	hidden = no 

	option = { # close it
		name = resource_production.1.a 
		random_owned_state={
			limit={
				steel_mill > 0
			}
			remove_building = {
				type = steel_mill
				level = 1
			}
			set_building_level = {
				type = steel_mill_inactive
				level = 1
				instant_build = yes
			}
		}
	}
}
country_event = {#not enough steel or coal to produce machine parts, close a manufactory
	id = resource_production.2
	title = resource_production.2.t 
	desc = resource_production.2.d

	picture = GFX_report_event_election_vote

	trigger = {
		any_owned_state={
			machine_parts_factory > 0
		}
		OR={
			check_variable = { resource@steel < 0}
			check_variable = { resource@coal < 0}
		}
	}

	mean_time_to_happen = {
		days = 20
		#modifier = {
		#	factor = 10 # If true multiply 20 by 10 = 200
		#	is_ai = yes
		#}
	}

	hidden = no 

	option = { # close it
		name = resource_production.2.a
		random_owned_state={
			limit={
				machine_parts_factory > 0
			}
			remove_building = {
				type = machine_parts_factory
				level = 1
			}
			set_building_level = {
				type = machine_parts_factory_inactive
				level = 1
				instant_build = yes
			}
		}
	}
}
country_event = {#not enough cotton to produce fabric, close a weavery
	id = resource_production.3
	title = resource_production.3.t 
	desc = resource_production.3.d

	picture = GFX_report_event_election_vote

	trigger = {
		any_owned_state={
			fabric_weavery > 0
		}
		check_variable = { resource@cotton < 0}
	}

	mean_time_to_happen = {
		days = 20
		#modifier = {
		#	factor = 10 # If true multiply 20 by 10 = 200
		#	is_ai = yes
		#}
	}

	hidden = no 

	option = { # close it
		name = resource_production.3.a
		random_owned_state={
			limit={
				fabric_weavery > 0
			}
			remove_building = {
				type = fabric_weavery
				level = 1
			}
			set_building_level = {
				type = fabric_weavery_inactive
				level = 1
				instant_build = yes
			}
		}
	}
}
#country_event = {#not enough silicates, plastics or rare earth metals to produce electronics, close a electronics factory
#	id = resource_production.4
#	title = resource_production.4.t 
#	desc = resource_production.4.d
#
#	picture = GFX_report_event_election_vote
#
#	trigger = {
#		any_owned_state={
#			electronics_factory > 0
#		}
#		OR={
#			check_variable = { resource@rare_earth_metals < 0}
#			check_variable = { resource@silicates < 0}
#			check_variable = { resource@plastics < 0}
#		}
#	}
#
#	mean_time_to_happen = {
#		days = 20
#		#modifier = {
#		#	factor = 10 # If true multiply 20 by 10 = 200
#		#	is_ai = yes
#		#}
#	}
#
#	hidden = no 
#
#	option = { # close it
#		name = resource_production.4.a
#		random_owned_state={
#			limit={
#				electronics_factory > 0
#			}
#			remove_building = {
#				type = electronics_factory
#				level = 1
#			}
#			set_building_level = {
#				type = electronics_factory_inactive
#				level = 1
#				instant_build = yes
#			}
#		}
#	}
#}
#country_event = {#not enough silicates to produce ceramics, close a ceramic buner
#	id = resource_production.5
#	title = resource_production.5.t 
#	desc = resource_production.5.d
#
#	picture = GFX_report_event_election_vote
#
#	trigger = {
#		any_owned_state={
#			ceramic_buners > 0
#		}
#		check_variable = { resource@cotton < 0}
#	}
#
#	mean_time_to_happen = {
#		days = 20
#		#modifier = {
#		#	factor = 10 # If true multiply 20 by 10 = 200
#		#	is_ai = yes
#		#}
#	}
#
#	hidden = no 
#
#	option = { # close it
#		name = resource_production.5.a
#		random_owned_state={
#			limit={
#				ceramic_buners > 0
#			}
#			remove_building = {
#				type = ceramic_buners
#				level = 1
#			}
#			set_building_level = {
#				type = ceramic_buners_inactive
#				level = 1
#				instant_build = yes
#			}
#		}
#	}
#}
#country_event = {#not enough oil to produce plastics, close a plastics manufactory
#	id = resource_production.6
#	title = resource_production.6.t 
#	desc = resource_production.6.d
#
#	picture = GFX_report_event_election_vote
#
#	trigger = {
#		any_owned_state={
#			plastics_refinery > 0
#		}
#		check_variable = { resource@oil < 0}
#	}
#
#	mean_time_to_happen = {
#		days = 20
#		#modifier = {
#		#	factor = 10 # If true multiply 20 by 10 = 200
#		#	is_ai = yes
#		#}
#	}
#
#	hidden = no 
#
#	option = { # close it
#		name = resource_production.6.a
#		random_owned_state={
#			limit={
#				plastics_refinery > 0
#			}
#			remove_building = {
#				type = plastics_refinery
#				level = 1
#			}
#			set_building_level = {
#				type = plastics_refinery_inactive
#				level = 1
#				instant_build = yes
#			}
#		}
#	}
#}
#country_event = {#not enough rare earth metals to produce power sources, close a generator factory
#	id = resource_production.7
#	title = resource_production.7.t 
#	desc = resource_production.7.d
#
#	picture = GFX_report_event_election_vote
#
#	trigger = {
#		any_owned_state={
#			generator_factory > 0
#		}
#		check_variable = { resource@oil < 0}
#	}
#
#	mean_time_to_happen = {
#		days = 20
#		#modifier = {
#		#	factor = 10 # If true multiply 20 by 10 = 200
#		#	is_ai = yes
#		#}
#	}
#
#	hidden = no 
#
#	option = { # close it
#		name = resource_production.7.a
#		random_owned_state={
#			limit={
#				generator_factory > 0
#			}
#			remove_building = {
#				type = generator_factory
#				level = 1
#			}
#			set_building_level = {
#				type =generator_factory_inactive
#				level = 1
#				instant_build = yes
#			}
#		}
#	}
#}