operations = {
	zha_ukrepleniya_na_vostoke = {
		icon = generic_operation	
		available = {
			has_war = no
			controls_state = 1097
			controls_state = 606
			controls_state = 1099
			controls_state = 607
			num_of_civilian_factories_available_for_projects > 7
		}
		visible = {
			has_completed_focus = zha_oborona_granitsy_jungo
		}
		fire_only_once = yes
		modifier = {
			civilian_factory_use = 8
		}
		cost = 80
		days_remove = 120
		ai_will_do = {
			factor = 5
		}
		remove_effect = {			
			country_event = {
				id = hanchines.3
			}
		}
	}
	zha_ukrepleniya_zapad = {
		icon = generic_operation	
		available = {
			has_war = no
			controls_state = 1118
			controls_state = 744
			controls_state = 283			
			num_of_civilian_factories_available_for_projects > 7
		}
		visible = {
			has_completed_focus = zha_oborona_granitsy_jungo
		}
		fire_only_once = yes
		modifier = {
			civilian_factory_use = 8
		}
		cost = 80
		days_remove = 120
		ai_will_do = {
			factor = 5
		}
		remove_effect = {			
			country_event = {
				id = hanchines.6
			}
		}
	}
}
ZHA_tech_decis = {
	zha_vyhod_vo_vneshn_politiku_tehnokrady = {
		icon = generic_political_discourse
		available = {
			has_stability > 0.5
			has_civil_war = no
		}
		visible = {
			has_completed_focus = zha_technokrat_movement
			has_government = democratic
			NOT = {
				has_completed_focus = zha_konvfikt_na_vostoke
			}
		}
		fire_only_once = yes		
		cost = 50
		complete_effect = {
			complete_national_focus = zha_konvfikt_na_vostoke
			country_event = {
				id = hanchines.24
			}			
		}
		ai_will_do = {
			factor = 10
		}
	}
	ZHA_worker_conditions = {
		icon = generic_industry
		available = {
			has_stability < 0.85
		}
		visible = {
			has_completed_focus = zha_programma_vozdeistviya
		}
		fire_only_once = no
		modifier = {
			stability_weekly = 0.005			
		}
		days_remove = 170
		days_re_enable = 365
		cost = 80
		complete_effect = {

		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 1
				has_stability < 0.6
			}
		}
	}
	ZHA_war_supp = {
		icon = generic_political_discourse
		available = {
			has_war_support < 0.85
		}
		visible = {
			has_completed_focus = zha_programma_vozdeistviya
		}
		fire_only_once = no
		modifier = {
			war_support_weekly = 0.005			
		}
		days_remove = 170
		days_re_enable = 365
		cost = 80
		complete_effect = {

		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 1
				has_war_support < 0.6
			}
		}
	}

}
#########################
ZHA_mandate_of_heaven_decis = {
	zha_vyhod_vo_vneshn_politiku = {
		icon = generic_political_discourse
		available = {
			has_stability > 0.75
			has_civil_war = no
		}
		visible = {
			has_completed_focus = zha_vlast_imperatritsi
			has_government = fascism
			NOT = {
				has_completed_focus = zha_konvfikt_na_vostoke
			}
		}
		fire_only_once = yes		
		cost = 50
		complete_effect = {
			complete_national_focus = zha_konvfikt_na_vostoke
			country_event = {
				id = hanchines.23
			}			
		}
		ai_will_do = {
			factor = 10
		}
	}
	zha_vernut_uan_v_sostav = {
		icon = generic_political_discourse
		available = {
			has_stability > 0.7
			has_war_support > 0.7
			has_civil_war = no
			ZTA = {
				NOT = {
					is_puppet_of = ZHA
				}
			}
		}
		visible = {
			has_country_flag = zha_vernut_uan_v_sostav_flag
			ZTA = {
				exists = yes
				NOT = {
					is_puppet_of = ZHA
					has_war_with = ZHA
					is_in_faction_with = ZHA
				}
			}
		}
		fire_only_once = yes		
		cost = 50
		complete_effect = {
			add_named_threat = { threat = 6 name = zha_snova_za_svoye_zta_threattt }
			every_state = {
				limit = { is_core_of = ZTA }				
				add_claim_by = ZHA
			}
			declare_war_on = {
				type = annex_everything
				target = ZTA
			}
		}
		ai_will_do = {
			factor = 10
		}
	}
	zha_prazdnik_dinastii = {
		icon = generic_political_discourse
		available = {
			has_completed_focus = zha_vlast_imperatritsi
			has_government = fascism
		}
		visible = {
			has_completed_focus = zha_vlast_imperatritsi
			has_government = fascism
		}
		fire_only_once = yes		
		cost = 50
		complete_effect = {			
			add_stability = 0.03
		}
		ai_will_do = {
			factor = 5
		}
	}
	zha_mission_warlords_rebellion = {
		icon = generic_civil_support
		visible = {
			original_tag = ZHA
		}		
		available = {
			OR = {
				has_stability > 0.65				
#				has_completed_focus = zha_novaya_armya_1
				has_completed_focus = zha_vopros_s_warlordami
				NOT = {
					has_idea = zha_nepokorstvo_warlordov
					has_idea = zha_nepokorstvo_warlordov_2
					has_idea = zha_nepokorstvo_warlordov_3
				}
			}
		}
		days_mission_timeout = 180
		#days_remove = 1
		activation = {
			has_civil_war = no
			OR = {
				has_idea = zha_nepokorstvo_warlordov
				has_idea = zha_nepokorstvo_warlordov_2
				has_idea = zha_nepokorstvo_warlordov_3				
			}
		}
		fixed_random_seed = no
		fire_only_once = no
		is_good = no
		timeout_effect = {
			if = {
				limit = {
					has_idea = zha_nepokorstvo_warlordov_3
				}
				remove_ideas = zha_nepokorstvo_warlordov_3
				country_event = {
					id = hanchines.36
				}
			}
			else_if = {
				limit = {
					has_idea = zha_nepokorstvo_warlordov_2
				}
				swap_ideas = {
					remove_idea = zha_nepokorstvo_warlordov_2
					add_idea = zha_nepokorstvo_warlordov_3
				}
			}
			else_if = {
				limit = {
					has_idea = zha_nepokorstvo_warlordov
				}
				swap_ideas = {
					remove_idea = zha_nepokorstvo_warlordov
					add_idea = zha_nepokorstvo_warlordov_2
				}
			}			
		}
	}
	
	zha_mission_the_struggle_for_heavens_mandate = {
		icon = generic_civil_support
		visible = {
			original_tag = ZHA
		}		
		available = {
			OR = {
				has_stability > 0.23				
				has_civil_war = yes
				NOT = {
					has_government = fascism
				}
			}
		}
		cancel_if_not_visible = yes
		days_mission_timeout = 220
		#days_remove = 1
		activation = {
			has_government = fascism
			has_civil_war = no
			has_stability < 0.22
		}
		fixed_random_seed = no
		fire_only_once = no
		is_good = no
		timeout_effect = {
			country_event = { id = hanchines.38 }
		}
	}
#################################################
	zha_mission_skoro_defolt = {
		icon = generic_civil_support
		visible = {
			original_tag = ZHA
		}		
		available = {
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
#				check_variable = {
#					zha_summa_dolga > 150
#				}
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = greater_than_or_equals
				}
			}	
		}
		days_mission_timeout = 195
#		days_mission_timeout = 185
		#days_remove = 1
		activation = {
			has_civil_war = no
			has_idea = zha_promyshlennaya_otstalost
		}
		fixed_random_seed = no
		fire_only_once = yes
		is_good = no
		timeout_effect = {
			custom_effect_tooltip = zha_mission_skoro_defolt_tt
			remove_ideas = zha_promyshlennaya_otstalost
			if = {
				limit = {
					check_variable = {
						var = zha_summa_dolga
						value = 50
						compare = less_than_or_equals
					}
				}
				add_timed_idea = {
					idea = zha_defolt_nachalsya
					days = 850
				}
			}
			if = {
				limit = {
					check_variable = {
						var = zha_summa_dolga
						value = 50
						compare = greater_than
					}
					check_variable = {
						var = zha_summa_dolga
						value = 100
						compare = less_than_or_equals
					}
				}
				add_timed_idea = {
					idea = zha_defolt_nachalsya_mediumm
					days = 600
				}
			}
			if = {
				limit = {
					check_variable = {
						var = zha_summa_dolga
						value = 100
						compare = greater_than
					}
				}
				add_timed_idea = {
					idea = zha_defolt_nachalsya_smalll
					days = 300
				}
			}			
			country_event = { id = hanchines.58 }
		}
	}
################
	zha_defolt_prodat_zavody = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			any_state = {
				is_fully_controlled_by = ZHA
				industrial_complex > 1
			}
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			custom_effect_tooltip = zha_defolt_prodat_zavody_tt			
#			country_event = { id = hanchines.59 }
			random_owned_controlled_state = {
				limit = {
					industrial_complex > 1								
				}
				remove_building = {
					type = industrial_complex
					level = 2
				}
			}			
			add_to_variable = {
				var = zha_summa_dolga
				value = 15
			}
		}
		ai_will_do = {
			factor = 100
		}
	}
	
	zha_defolt_finansovye_rezervy = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost	
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 80
		complete_effect = {			
			custom_effect_tooltip = zha_defolt_finansovye_rezervy_tt
			add_stability = 0.02
			add_to_variable = {
				var = zha_summa_dolga
				value = 20
			}
		}
		ai_will_do = {
			factor = 200
		}
	}
	
	zha_defolt_sokratit_finans_nauki_i_obr = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			add_timed_idea = {
				idea = zha_sokrashenie_finansirovan
				days = 400
			}
			custom_effect_tooltip = zha_defolt_sokratit_finans_nauki_i_obr_tt
			add_to_variable = {
				var = zha_summa_dolga
				value = 20
			}
		}
		ai_will_do = {
			factor = 150
		}
	}
	
	zha_defolt_sokratit_finans_oborony = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			add_timed_idea = {
				idea = zha_sokrashenie_finans_oborony
				days = 400
			}
			custom_effect_tooltip = zha_defolt_sokratit_finans_oborony_tt
			add_to_variable = {
				var = zha_summa_dolga
				value = 20
			}
		}
		ai_will_do = {
			factor = 50
		}
	}
	
	zha_defolt_zakrit_army_fact = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			any_state = {
				is_fully_controlled_by = ZHA
				arms_factory > 1
			}
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			custom_effect_tooltip = zha_defolt_zakrit_army_fact_tt
			random_owned_controlled_state = {
				limit = {
					arms_factory > 1								
				}
				remove_building = {
					type = arms_factory
					level = 2
				}
			}			
			add_to_variable = {
				var = zha_summa_dolga
				value = 15
			}
		}
		ai_will_do = {
			factor = 150
		}
	}
	zha_defolt_umenshit_finans_marionetok = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			num_subjects > 0
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			custom_effect_tooltip = zha_defolt_umenshit_finans_marionetok_tt
			add_to_variable = {
				var = zha_summa_dolga
				value = 15
			}
			every_other_country = {
				limit = { is_puppet_of = ZHA }
				country_event = { id = hanchines.60 }
			}
		}
		ai_will_do = {
			factor = 5
		}
	}
	
	zha_defolt_kredit_ot_dongvu = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			NOT = {
				has_war_with = XNU	
			}
			XNU = {
				exists = yes
				has_opinion = {
					target = ZHA
					value > -20
				}
			}
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			custom_effect_tooltip = zha_defolt_kredit_ot_dongvu_tt
			XNU = {
				country_event = { id = hanchines.61 }
			}
		}
		ai_will_do = {
			factor = 70
		}
	}
	
	zha_defolt_kredit_ot_korei = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			NOT = {
				has_war_with = ZCS	
			}
			ZCS = {
				exists = yes
				has_opinion = {
					target = ZHA
					value > -20
				}
			}
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			custom_effect_tooltip = zha_defolt_kredit_ot_korei_tt
			ZCS = {
				country_event = { id = hanchines.64 }
			}
		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 20
				has_country_flag = zha_go_to_korea_defolt
			}			
		}
	}
	zha_defolt_kredit_ot_japan_imperator = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			NOT = {
				has_war_with = ZJA	
			}
			ZJA = {
				exists = yes
				has_opinion = {
					target = ZHA
					value > -20
				}
			}
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
			ZJA = {
				has_government = neutrality
			}
			NOT = {
				has_global_flag = shogun_perevorot_flag
			}
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			custom_effect_tooltip = zha_defolt_kredit_ot_japan_imperator_tt
			ZJA = {
				country_event = { id = hanchines.74 }
			}
		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 20
				has_country_flag = zha_go_to_japan_defolt
			}
		}
	}
	zha_defolt_kredit_ot_japan_segun = {
		icon = generic_political_discourse
		available = {
			has_idea = zha_promyshlennaya_otstalost
			NOT = {
				has_war_with = ZJA	
			}
			ZJA = {
				exists = yes
				has_opinion = {
					target = ZHA
					value > -20
				}
			}
			custom_trigger_tooltip = {
				tooltip = zha_mission_skoro_defolt_chek_summa_dolga
				check_variable = {
					var = zha_summa_dolga
					value = 150
					compare = less_than
				}
			}
		}
		visible = {
			has_idea = zha_promyshlennaya_otstalost
			ZJA = {
				has_government = fascism
			}			
			has_global_flag = shogun_perevorot_flag			
		}
		fire_only_once = yes		
		cost = 3
		complete_effect = {
			custom_effect_tooltip = zha_defolt_kredit_ot_japan_segun_tt
			ZJA = {
				country_event = { id = hanchines.77 }
			}
		}
		ai_will_do = {
			base = 0
			modifier = {
				add = 20
				has_country_flag = zha_go_to_japan_defolt
			}
		}
	}
#################
	zha_pomosh_orujiem_imperaatory_znp = {
		icon = generic_political_discourse
		available = {
			has_government = fascism
			has_equipment = {
				infantry_equipment > 319
			}
			NOT = {
				has_war_with = ZNP	
			}
			ZNP = {
				exists = yes
				has_war = yes
				has_government = neutrality
				has_country_leader = {
					name = "Yoshiro"
				}	
			}
		}
		visible = {
			has_global_flag = zha_imperatoe_dolg_defolt							
			has_global_flag = shogun_perevorot_flag			
		}
		fire_only_once = no		
		days_re_enable = 40		
		cost = 10
		complete_effect = {
			custom_effect_tooltip = zha_pomosh_orujiem_imperaatory_znp_tt
			ZNP = {
				country_event = { id = hanchines.80 }
			}
		}
		ai_will_do = {
			factor = 10
		}
	}
	zha_pomosh_orujiem_segunatu_znp = {
		icon = generic_political_discourse
		available = {
			has_government = fascism
			has_equipment = {
				infantry_equipment > 319
			}
			NOT = {
				has_war_with = ZJA	
			}
			ZJA = {
				exists = yes				
				has_government = fascism					
			}
			custom_trigger_tooltip = {
				tooltip = zha_pomosh_orujiem_segunatu_chek_skilko_postavok
				check_variable = {
					var = zha_seguny_skolkovernulidolga_var
					value = 10
					compare = less_than_or_equals
				}
			}			
		}
		visible = {
			has_global_flag = zha_segunat_dolg_defolt							
			has_global_flag = shogun_perevorot_flag
			ZJA = {
				exists = yes				
				has_government = fascism					
			}
		}
		fire_only_once = no		
		days_re_enable = 45		
		cost = 10
		complete_effect = {
			custom_effect_tooltip = zha_pomosh_orujiem_segunatu_znp_tt
			ZJA = {
				country_event = { id = hanchines.81 }
			}
			add_to_variable = {
				var = zha_seguny_skolkovernulidolga_var
				value = 1
			}
		}
		ai_will_do = {
			factor = 10
		}
	}
	zha_pogasit_dolg_pered_segunatu = {
		icon = generic_political_discourse
		available = {
			has_government = fascism			
			NOT = {
				has_war_with = ZJA	
			}
			ZJA = {
				exists = yes				
				has_government = fascism					
			}
			custom_trigger_tooltip = {
				tooltip = zha_pogasit_dolg_pered_segunatu_chek_skilko_postavok
				check_variable = {
					var = zha_seguny_skolkovernulidolga_var
					value = 10
					compare = greater_than_or_equals
				}
			}			
		}
		visible = {
			has_global_flag = zha_segunat_dolg_defolt							
			has_global_flag = shogun_perevorot_flag
			ZJA = {
				exists = yes				
				has_government = fascism					
			}			
		}
		fire_only_once = yes			
		cost = 10
		complete_effect = {			
			ZJA = {
				country_event = { id = hanchines.93 }
			}
		}
		ai_will_do = {
			factor = 50
		}
	}
	
}

