UKR_crimea_category = {
	UKR_negotiate_crimea = {
		icon = generic_political_discourse
		fire_only_once = yes
		cost = 500
		available = {
			tag = UKR
			is_ally_with = SOV
			137 = {
				is_owned_by = SOV
			}
			972 = {
				is_owned_by = SOV
			}
		}
		ai_will_do = {
			base = 1000
		}
		complete_effect = {
			137 = {
				transfer_state_to = CRI
			}
			972 = {
				transfer_state_to = SEV
			}
			CRI = {
				remove_ideas = {CRI_new_moon CRI_half_moon CRI_black_sea_veto}
				load_focus_tree = generic_focus
			}
			UKR = {
				puppet = SEV
				puppet = CRI
			}
		}
	}
	UKR_retake_crimea = {
		icon = generic_prepare_civil_war
		fire_only_once = yes
		cost = 200
		available = {
			tag = UKR
			is_ally_with = USA
		}
		ai_will_do = {
			base = 1000
		}
		complete_effect = {
			137 = {
				owner = {
					declare_war_on = {
						target = ROOT
						type = topple_government
					}
				}
			}
			#create_wargoal = {
			#	target = SOV
			#	type = take_state_focus
			#	generator = {137}
			#}
		}
	}
}
CRI_guides_category = {
	CRI_show_guide = {
		icon = generic_political_discourse
		fire_only_once = no
		complete_effect = {
			country_event = crimea.666
		}
	}
	CRI_show_guide_2 = {
		icon = generic_political_discourse
		fire_only_once = no
		complete_effect = {
			country_event = crimea.667
		}
	}
}
investments_output = {
	CRI_buy_civilian = {
		icon = GFX_decision_generic_construction
		available= {
			check_variable = {
				crimean_common_budget > 10
			}
			has_country_flag = can_invest
		}
		visible = {
			has_completed_focus = CRI_south_european_company
		}
		fire_only_once = no
		cost = 10
		days_remove = 30
		#modifier = {
		#			
		#}
		remove_effect = {
			add_offsite_building = {type = industrial_complex level = 1}
			add_to_variable = {
				var = crimean_common_budget
				value = -10
			}
		}
	}
	CRI_buy_dockyards = {
		icon = GFX_decision_generic_naval
		available = {
			check_variable = {
				crimean_common_budget > 15
			}
			has_country_flag = can_invest
		}
		visible = {
			has_completed_focus = CRI_south_european_company
		}
		fire_only_once = no
		cost = 15
		days_remove = 30
		#modifier = {
		#			
		#}
		remove_effect = {
			add_offsite_building = {type = dockyard level = 1}
			add_to_variable = {
				var = crimean_common_budget
				value = -15
			}
		}
	}
	CRI_buy_military = {
		icon = generic_prepare_civil_war
		available  = {
			check_variable = {
				crimean_common_budget > 15
			}
			has_country_flag = can_invest
		}
		visible = {
			has_completed_focus = CRI_south_european_company
		}
		fire_only_once = no
		cost = 15
		days_remove = 30
		#modifier = {
		#			
		#}
		remove_effect = {
			add_offsite_building = {type = arms_factory level = 1}
			add_to_variable = {
				var = crimean_common_budget
				value = -15
			}
		}
	}
	CRI_buy_greece = {
		icon = generic_political_discourse
		available = {
			check_variable = {
				crimean_common_budget > 5
			}
			has_country_flag = can_invest
		}
		visible = {
			has_completed_focus = CRI_south_european_company
		}
		fire_only_once = no
		cost = 5
		days_remove = 7
		#modifier = {
		#			
		#}
		remove_effect = {
			add_to_variable = {
				var = crimean_greece_influence
				value = 5
			}
			add_to_variable = {
				var = crimean_common_budget
				value = -5
			}
		}
	}
	CRI_buy_genoa_venetia = {
		icon = generic_political_discourse
		available = {
			check_variable = {
				crimean_common_budget > 5
			}
			has_country_flag = can_invest
		}
		visible = {
			has_completed_focus = CRI_genoa_venetia
		}
		fire_only_once = no
		cost = 5
		days_remove = 7
		#modifier = {
		#			
		#}
		remove_effect = {
			add_to_variable = {
				var = crimean_italy_influence
				value = 5
			}
			add_to_variable = {
				var = crimean_genoa_influence
				value = 5
			}
			add_to_variable = {
				var = crimean_common_budget
				value = -5
			}
		}
	}
	CRI_buy_papacy = {
		icon = generic_political_discourse
		available = {
			check_variable = {
				crimean_common_budget > 5
			}
			has_country_flag = can_invest
		}
		visible = {
			has_completed_focus = CRI_papacy_reborn
		}
		fire_only_once = no
		cost = 5
		days_remove = 7
		#modifier = {
		#			
		#}
		remove_effect = {
			add_to_variable = {
				var = crimean_italy_influence
				value = 5
			}
			add_to_variable = {
				var = crimean_papacy_influence
				value = 5
			}
			add_to_variable = {
				var = crimean_common_budget
				value = -5
			}
		}
	}
	CRI_buy_south = {
		icon = generic_political_discourse
		available = {
			check_variable = {
				crimean_common_budget > 5
			}
			has_country_flag = can_invest
		}
		visible = {
			has_completed_focus = CRI_extend_southern_company
		}
		fire_only_once = no
		cost = 5
		days_remove = 7
		#modifier = {
		#			
		#}
		remove_effect = {
			add_to_variable = {
				var = crimean_italy_influence
				value = 5
			}
			add_to_variable = {
				var = crimean_sicily_influence
				value = 5
			}
			add_to_variable = {
				var = crimean_common_budget
				value = -5
			}
		}
	}
	CRI_ignite_civil_war = {
		icon = generic_prepare_civil_war
		available = {
			check_variable = {
				crimean_common_budget > 15
			}
			has_country_flag = can_invest
			OR = {
				check_variable = {
					crimean_italy_influence > italian_italy_influence
				}
				check_variable = {
					crimean_greece_influence > greek_greece_influence
				}
			}
		}
		fire_only_once = yes
		cost = 15
		complete_effect = {
			#clr_country_flag = can_invest
			set_variable = {
				temp_double_italy = italian_italy_influence
			}
			add_to_variable = {
				var = temp_double_italy
				value = italian_italy_influence
			}
			set_variable = {
				temp_double_greece = greek_greece_influence 
			}
			add_to_variable = {
				var = temp_double_greece
				value = greek_greece_influence
			}
			if = {
				limit = {
					check_variable = {
						crimean_italy_influence > temp_double_italy
					}
				}
				if = {
					limit = {
						NOT = {
							has_idea = CRI_first_world_country
						}
					}
					add_ideas = CRI_first_world_country
				}
				if = {
					limit = {
						check_variable = {
							crimean_sicily_influence > 30
						}
					}
					TTS = {
						every_core_state = {
							transfer_state_to = TTS
						}
					}
					ITA = {
						transfer_units_fraction = {
							target = TTS
							size = 0.34
						}
					}
					CRI = {
						puppet = TTS
						puppet = MLT
					}
					ITA = {
						news_event = critaly.005
					}
				}
				else = {
					ITA = {
						news_event = critaly.008
					}
				}
				if = {
					limit = {
						check_variable = {
							crimean_papacy_influence > 30
						}
					}
					PAP = {
						every_core_state = {
							transfer_state_to = PAP
						}
					}
					TOS = {
						every_core_state = {
							transfer_state_to = TOS
						}
					}
					ITA = {
						transfer_units_fraction = {
							target = PAP
							size = 0.25
						}
						transfer_units_fraction = {
							target = TOS
							size = 0.1
						}
					}
					CRI = {
						puppet = PAP
						puppet = TOS
						}
					ITA = {
						news_event = critaly.004
					}
				}
				else = {
					ITA = {
						news_event = critaly.007
					}
				}
				if = {
					limit = {
						check_variable = {
							crimean_genoa_influence > 30
						}
					}
					LBV = {
						every_core_state = {
							transfer_state_to = LBV
						}
					}
					SPM = {
						every_core_state = {
							transfer_state_to = SPM
						}
					}
					ITA = {
						transfer_units_fraction = {
							target = LBV
							size = 0.2
						}
						transfer_units_fraction = {
							target = SPM
							size = 0.2
						}
					}
					CRI = {
						puppet = LBV
						puppet = SPM
					}
					ITA = {
						news_event = critaly.003
					}
				}
				else = {
					ITA = {
						news_event = critaly.006
					}
				}
			}
			else = {
				ITA = {
					news_event = critaly.002
				}
			}
			if = {
				limit = {
					check_variable = {
						crimean_greece_influence > temp_double_greece
					}
				}
				if = {
					limit = {
						NOT = {
							has_idea = CRI_first_world_country
						}
					}
					add_ideas = CRI_first_world_country
				}
				if = {
					limit = {
						check_variable = {
							crimean_greece_influence > 50
						}
					}
					CRI = {
						puppet = GRE
						puppet = CYP
					}
					GRE = {
						news_event = creece.003
					}
				}
				else = {
					GRE = {
						news_event = creece.002
					}
				}
			}
			else = {
				GRE = {
					news_event = creece.002
				}
			}
		}
	}
}

prospect_for_resources = {
	CRI_nationalise_gas = { #597

		icon = oil

		allowed = {

		}

		highlight_states = {
			highlight_state_targets = {
				state = 137
			}
		}

		available = {
			has_tech = excavation1
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 137
			controls_state = 137
		}

		visible = {
			owns_state = 137
			controls_state = 137
			137 = {
				NOT = {
					has_state_flag = oil_nationalized
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		remove_effect = {
			137 = { set_state_flag = oil_nationalized}
			CRI = {
				set_country_flag = CRI_oil_found
			}
			137 = {
				add_resource = {
					type = oil
					amount = 25
				}
			}
		}
	}
	CRI_nationalise_titan = { #597

		icon = aluminium

		allowed = {

		}

		highlight_states = {
			highlight_state_targets = {
				state = 137
			}
		}

		available = {
			has_tech = excavation1
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 137
			controls_state = 137
		}

		visible = {
			owns_state = 137
			controls_state = 137
			137 = {
				NOT = {
					has_state_flag = titan_nationalized
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		remove_effect = {
			137 = { set_state_flag = titan_nationalized }
			137 = {
				add_resource = {
					type = aluminium
					amount = 50
				}
			}
		}
	}
}
CRI_romanov_category = {
	CRI_russian_romanovs = {
		state_target = yes
		on_map_mode = map_and_decisions_view
		icon = generic_form_nation
		highlight_states = {
			highlight_states_trigger = {
				is_owned_by = SOV
			}
		}
		target_trigger = {
			FROM = {
				is_owned_by = SOV
			}
		}
		target_root_trigger = {
			tag = CRI
		}
		cost = 12
		ai_will_do = {
			base = 300
		}
		allowed = {
			original_tag = CRI
		}
		visible = {
			has_completed_focus = CRI_romanov_russia_focus
		}
		fire_only_once = yes
		complete_effect = {
			add_to_variable = {
				var = CRI_romanov_russia_influence
				value = 0.009
			}
			FROM = {
				set_state_flag = CRI_romanov_russia_dirty
			}
			
		}
	}
	CRI_ukrainian_romanovs = {
		state_target = yes
		on_map_mode = map_and_decisions_view
		icon = generic_form_nation
		highlight_states = {
			highlight_states_trigger = {
				is_owned_by = UKR
			}
		}
		target_trigger = {
			FROM = {
				is_owned_by = UKR
			}
		}
		target_root_trigger = {
			tag = CRI
		}
		cost = 15
		ai_will_do = {
			base = 300
		}
		allowed = {
			original_tag = CRI
		}
		visible = {
			has_completed_focus = CRI_romanov_europe_focus
		}
		fire_only_once = yes
		complete_effect = {
			add_to_variable = {
				var = CRI_romanov_ukraine_influence
				value = 0.045
			}
			FROM = {
				set_state_flag = CRI_romanov_ukraine_dirty
			}
			
		}
	}
	CRI_belorussian_romanovs = {
		state_target = yes
		on_map_mode = map_and_decisions_view
		icon = generic_form_nation
		highlight_states = {
			highlight_states_trigger = {
				is_owned_by = BLR
			}
		}
		target_trigger = {
			FROM = {
				is_owned_by = BLR
			}
		}
		target_root_trigger = {
			tag = CRI
		}
		ai_will_do = {
			base = 300
		}
		visible = {
			has_completed_focus = CRI_romanov_europe_focus
		}
		cost = 12
		allowed = {
			original_tag = CRI
		}
		fire_only_once = yes
		complete_effect = {
			add_to_variable = {
				var = CRI_romanov_belarus_influence
				value = 0.12
			}
			FROM = {
				set_state_flag = CRI_romanov_belarus_dirty
			}
			
		}
	}
	CRI_turkestani_romanovs = {
		icon = generic_form_nation
		targets = {LIT LAT EST  MOL TRA  AZR GEO ABK ARM  KAZ TAJ KYR UZB TMS}
		cost = 50
		allowed = {
			original_tag = CRI
		}
		ai_will_do = {
			base = 500
		}
		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 30
				}
			}
		}
		visible = {
			has_completed_focus = CRI_romanov_otherlings_focus
		}
		fire_only_once = yes
		complete_effect = {
			FROM = {
				set_country_flag = CRI_romanov_country_dirty
			}
		}
	}
	CRI_ignite_debug = {
		icon = generic_form_nation
		#cost = 50
		days_mission_timeout = 365
		activation = {
			#has_completed_focus = CRI_reach_out_to_nobles
			CRI = {
				has_country_flag = CRI_civil_war_preparations
			}
		}
		allowed = {
			original_tag = CRI
		}
		available = {
			always = no
		}
		war_with_on_timeout = SOV
		#fire_only_once = yes
		timeout_effect = {
			CRI = {
				clr_country_flag = CRI_civil_war_preparations
				set_country_flag = CRI_civil_war_romanov
			}
			SOV = {
				transfer_units_fraction= {
					target = CRI
					size = var:CRI_romanov_russia_influence
					stockpile_ratio = var:CRI_romanov_russia_influence
					army_ratio = var:CRI_romanov_russia_influence
					navy_ratio = 0
					air_ratio = var:CRI_romanov_russia_influence
				}
				every_owned_state = {
					limit = {
						has_state_flag = CRI_romanov_russia_dirty
					}
					transfer_state_to = CRI
				}
				declare_war_on = {
					target = CRI
					type = annex_everything
				}
			}
			UKR = {
				transfer_units_fraction= {
					target = CRI
					size = var:CRI_romanov_ukraine_influence
					stockpile_ratio = var:CRI_romanov_ukraine_influence
					army_ratio = var:CRI_romanov_ukraine_influence
					navy_ratio = 0
					air_ratio = var:CRI_romanov_ukraine_influence
				}
				every_owned_state = {
					limit = {
						has_state_flag = CRI_romanov_ukraine_dirty
					}
					transfer_state_to = CRI
				}
				declare_war_on = {
					target = CRI
					type = annex_everything
				}
			}
			BLR = {
				transfer_units_fraction= {
					target = CRI
					size = var:CRI_romanov_belarus_influence
					stockpile_ratio = var:CRI_romanov_belarus_influence
					army_ratio = var:CRI_romanov_belarus_influence
					navy_ratio = 0
					air_ratio = var:CRI_romanov_belarus_influence
				}
				every_owned_state = {
					limit = {
						has_state_flag = CRI_romanov_belarus_dirty
					}
					transfer_state_to = CRI
				}
				declare_war_on = {
					target = CRI
					type = annex_everything
				}
			}
			if = {
				limit = {
					KAZ = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = KAZ
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = KAZ
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					country_exists = DON
				}
				CRI = {
					annex_country = {
						target = DON
						transfer_troops = yes
					}
				}
			}
			if = {
				limit = {
					country_exists = KUB
				}
				CRI = {
					annex_country = {
						target = KUB
						transfer_troops = yes
					}
				}
			}
			if = {
				limit = {
					UZB = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = UZB
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = UZB
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					TAJ = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = TAJ
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = TAJ
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					TMS = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = TMS
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = TMS
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					KYR = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = KYR
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = KYR
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					AZR = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = AZR
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = AZR
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					GEO = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = GEO 
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = GEO
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					ARM = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = ARM
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = ARM
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					ABK = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = ABK
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = ABK
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					MOL = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = MOL
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = MOL
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					TRA = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = TRA 
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = TRA
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					EST = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = EST 
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = EST
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					LAT = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = LAT
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = LAT
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					LIT = {
						has_country_flag = CRI_romanov_country_dirty
					}
				}
				CRI = {
					annex_country = {
						target = LIT
						transfer_troops = yes
					}
				}
			}
			else = {
				CRI = {
					create_wargoal = {
						target = LIT
						type = annex_everything
					}
				}
			}
			if = {
				limit = {
					NOT = {
						country_exists = SOV
						country_exists = UKR
						country_exists = BLR
						country_exists = AZR
						country_exists = ARM
						country_exists = GEO
						country_exists = ABK
						country_exists = MOL
						country_exists = TRA
						country_exists = LIT
						country_exists = LAT
						country_exists = EST
						country_exists = DON
						country_exists = KUB
						country_exists = KAZ
						country_exists = KYR
						country_exists = UZB
						country_exists = TAJ
						country_exists = TMS
					}
				}
				set_country_flag = CRI_sov_fair_and_square
			}
		}
	}
}

CRI_recognition_category = {
	CRI_foreign_intervention = {
		days_mission_timeout = 140
		is_good = no
		#fire_only_once = yes
		war_with_on_timeout = USA
		available = {
			OR = {
				ROOT = {
					NOT = {
						has_idea = CRI_new_moon
					}
				}
				ROOT = {
					is_subject_of = UKR
				}
				ROOT = {
					NOT = {
						original_tag = CRI
					}
				}
			}
		}
		complete_effect = {
			#add_political_power = 150
		}
		timeout_effect = {
			USA = {
				declare_war_on = {
					target = ROOT
					type = annex_everything
				}
			}
		}
	}
	CRI_try_to_gain_recognition= {
		icon = generic_form_nation
		targets = {PRC SOV ENG USA FRA}
		cost = 50
		ai_will_do = {
			base = 300
		}
		#allowed = {
		#	original_tag = CRI
		#}
		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 30
				}
			}
		}
		visible = {
			OR = {
				has_idea = CRI_half_moon
				has_idea = CRI_new_moon
			}
		}
		fire_only_once = yes
		complete_effect = {
			ROOT = {
				add_to_variable = {
					var = CRI_recognition_status
					value = 1
				}
			}
			IF = {
				limit = {
					ROOT = {
						check_variable = {
							CRI_recognition_status > 4
						}
					}
				}
				ROOT = {	
					swap_ideas = {
						remove_idea = CRI_half_moon
						add_idea = CRI_full_moon
					}
				}	
			}
			ELSE_IF = {
				limit = {
					ROOT = {
						check_variable = {
							CRI_recognition_status > 2
						}
					}
				}
				ROOT = {
					swap_ideas = {
						remove_idea = CRI_new_moon
						add_idea = CRI_half_moon
					}
				}
			}
		}
	}
}