##################################
####    PRC Scriped Effects   ####
##################################

######################
### -char effects- ###
######################

#hide character effect
PRC_hide_character_effect = {
	retire = yes
}

#recruit character
PRC_recruit_character_effect = {
	if = {
		limit = {
			NOT = {
				THIS = { has_character_flag = is_dead }
				PLA = { has_character = PREV }
			}
		}
		if = {
			limit = { THIS = { is_army_leader = yes } }
			demote_to_general = yes
			remove_trait = { trait = recently_promoted }
		}
		set_nationality = PRC
	}
}

#Party Approval
	PRC_add_party_approval = {
		custom_effect_tooltip = PRC_add_party_approval_tt
		
		add_to_variable = {
			var = PRC_approval_rating_var
			value = PRC_approval_rating_var_temp
		}
		
		clamp_variable = {
			var = PRC_approval_rating_var
			min = -0.5
			max = 1
		}

		set_variable = {
			var = PRC_approval_rating_dynamic_var
			value = PRC_approval_rating_var
		}
		
		multiply_variable = {
			var = PRC_approval_rating_dynamic_var
			value = 0.1
		}
	}

	PRC_add_capital_flight_timeout = {
		custom_effect_tooltip = PRC_capital_flight_timeout_tt
		
		add_to_variable = {
			var = PRC_capital_flight_timeout
			value = PRC_capital_flight_timeout_temp
		}
		
		clamp_variable = {
			var = PRC_capital_flight_timeout
			min = 0
			max = 1
		}
	}

	PRC_add_enviromental_progress = {
		if = {
			limit = {
				NOT = {
					has_country_flag = PRC_environmental_reform_success
				}
			}
			custom_effect_tooltip = PRC_add_enviromental_progress_tt
		
			add_to_variable = {
				var = PRC_enviromental_progress
				value = PRC_enviromental_progress_temp
			}

			clamp_variable = {
				var = PRC_enviromental_progress
				min = 0
				max = 1
			}
			if = {
				limit = {
					check_variable = {
						var = PRC_enviromental_progress
						value = 0.3
						compare = less_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.223 days = 6 }
				}
			}
			if = {
				limit = {
					check_variable = {
						var = PRC_enviromental_progress
						value = 0.2
						compare = less_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.224 days = 8 }
					country_event = { id = china.225 days = 45 }
				}
			}
		}
	}

	PRC_add_reforms_progress = {
		custom_effect_tooltip = PRC_add_reforms_progress_tooltip
		add_to_variable = {
			var = PRC_reforms_progress
			value = PRC_reforms_progress_temp
		}
	
		clamp_variable = {
			var = PRC_reforms_progress
			min = 0
			max = 100
		}		
	}

	PRC_add_xiongania_progress = {
		if = {
			limit = {
				NOT = {
					has_country_flag = PRC_capital_construction_process_is_finished_flag
				}
			}
			custom_effect_tooltip = PRC_add_xiongania_progress_tooltip
			add_to_variable = {
				var = PRC_xiongania_progress
				value = PRC_xiongania_progress_temp
			}

			clamp_variable = {
				var = PRC_xiongania_progress
				min = 0
				max = 100
			}

			if = {
				limit = {
					check_variable = {
						var = PRC_xiongania_progress
						value = 99
						compare = greater_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.413 days = 5 }
				}
			}
		}
	}

	PRC_decrease_overloaded_bureaucracy = {
		effect_tooltip = {
			swap_ideas = {					
				remove_idea = PRC_overloaded_bureaucracy_idea
				add_idea = PRC_overloaded_bureaucracy_idea_bad
			}
		}
		hidden_effect = {
			add_to_variable = {
				var = PRC_bureaucracy_conscription_factor_dynamic_var
				value = -0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_stability_factor_dynamic_var
				value = -0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_political_power_factor_dynamic_var
				value = -0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_production_speed_buildings_factor_dynamic_var
				value = -0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_industrial_capacity_factory_dynamic_var
				value = -0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_industrial_capacity_dockyard_dynamic_var
				value = -0.025
			}
		}		
	}

	PRC_increase_overloaded_bureaucracy = {
		effect_tooltip = {
			swap_ideas = {					
				remove_idea = PRC_overloaded_bureaucracy_idea
				add_idea = PRC_overloaded_bureaucracy_idea_good
			}
		}
		hidden_effect = {
			add_to_variable = {
				var = PRC_bureaucracy_conscription_factor_dynamic_var
				value = 0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_stability_factor_dynamic_var
				value = 0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_political_power_factor_dynamic_var
				value = 0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_production_speed_buildings_factor_dynamic_var
				value = 0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_industrial_capacity_factory_dynamic_var
				value = 0.025
			}
			add_to_variable = {
				var = PRC_bureaucracy_industrial_capacity_dockyard_dynamic_var
				value = 0.025
			}
		}		
	}

	PRC_add_loji_project_web_progress = {
		if = {
			limit = {
				NOT = {
					has_country_flag = PRC_loji_project_web_success
				}
			}
			custom_effect_tooltip = PRC_add_loji_project_web_progress_tooltip
			add_to_variable = {
				var = PRC_loji_project_web_progress
				value = PRC_loji_project_web_progress_temp
			}

			clamp_variable = {
				var = PRC_loji_project_web_progress
				min = 0
				max = 1
			}
			if = {
				limit = {
					check_variable = {
						var = PRC_loji_project_web_progress
						value = 0.99
						compare = greater_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.481 days = 1 }
				}
			}
		}		
	}

	PRC_add_afg_current_eco_dependence = {
		if = {
			limit = {
				NOT = {
					has_country_flag = PRC_afghanistan_initiative_eco_success
				}
			}
			custom_effect_tooltip = PRC_add_afg_current_eco_dependence_tooltip
			add_to_variable = {
				var = PRC_afg_current_eco_dependence
				value = PRC_afg_current_eco_dependence_temp
			}

			clamp_variable = {
				var = PRC_afg_current_eco_dependence
				min = 0
				max = 1
			}
			if = {
				limit = {
					check_variable = {
						var = PRC_afg_current_eco_dependence
						value = 0.95
						compare = greater_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.364 days = 1 }
				}
			}
		}		
	}

	PRC_add_afg_current_gov_loyalty = {
		if = {
			limit = {
				NOT = {
					has_country_flag = PRC_afghanistan_initiative_gov_success
				}
			}
			custom_effect_tooltip = PRC_add_afg_current_gov_loyalty_tooltip
			add_to_variable = {
				var = PRC_afg_current_gov_loyalty
				value = PRC_afg_current_gov_loyalty_temp
			}

			clamp_variable = {
				var = PRC_afg_current_gov_loyalty
				min = 0
				max = 1
			}
			if = {
				limit = {
					check_variable = {
						var = PRC_afg_current_gov_loyalty
						value = 0.95
						compare = greater_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.365 days = 1 }
				}
			}
			if = {
				limit = {
					check_variable = {
						var = PRC_afg_current_gov_loyalty
						value = 0.1
						compare = less_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.371 days = 1 }
				}
			}
		}		
	}

	PRC_add_eternal_capital_progress = {
		if = {
			limit = {
				NOT = {
					has_country_flag = PRC_eternal_capital_project_is_finished_flag
				}
			}
			custom_effect_tooltip = PRC_add_eternal_capital_progress_tooltip
			add_to_variable = {
				var = PRC_eternal_capital_progress
				value = PRC_eternal_capital_progress_temp
			}

			clamp_variable = {
				var = PRC_eternal_capital_progress
				min = 0
				max = 1
			}

			if = {
				limit = {
					check_variable = {
						var = PRC_eternal_capital_progress
						value = 0.99
						compare = greater_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.392 hours = 6 }
				}
			}
		}
	}

	PRC_add_army_reform_progress = {
		if = {
			limit = {
				NOT = {
					has_country_flag = PRC_army_reform_success
				}
			}
			custom_effect_tooltip = PRC_add_army_reform_progress_tooltip
			add_to_variable = {
				var = PRC_army_reform_progress
				value = PRC_army_reform_progress_temp
			}

			clamp_variable = {
				var = PRC_army_reform_progress
				min = 0
				max = 1
			}
			if = {
				limit = {
					check_variable = {
						var = PRC_army_reform_progress
						value = 0.99
						compare = greater_than_or_equals
					}
				}
				PRC = {
					country_event = { id = china.278 days = 1 }
				}
			}
		}		
	}
	#Corona
	PRC_decrease_corona = {
		if = {
			limit = {
				has_idea = PRC_coronavirus_pandemic_idea4
			}
			remove_ideas = PRC_coronavirus_pandemic_idea4
			set_country_flag = PRC_no_coronavirus
		}
		else_if = {
			limit = { 
				has_idea = PRC_coronavirus_pandemic_idea3
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea3
				add_idea = PRC_coronavirus_pandemic_idea4
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_coronavirus_pandemic_idea2
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea2
				add_idea = PRC_coronavirus_pandemic_idea3
			}
		}
		else_if = {
			limit = { 
				has_idea = PRC_coronavirus_pandemic_idea1 
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea1
				add_idea = PRC_coronavirus_pandemic_idea2
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_coronavirus_pandemic_idea
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea
				add_idea = PRC_coronavirus_pandemic_idea1
			}
		}
	}
	
	PRC_decrease_oil = {
		if = {
			limit = {
				has_idea = PRC_oil_crash5
			}
			remove_ideas = PRC_oil_crash5
		}
		else_if = {
			limit = { 
				has_idea = PRC_oil_crash4
			}
			swap_ideas = {
				remove_idea = PRC_oil_crash4
				add_idea = PRC_oil_crash5
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_oil_crash3
			}
			swap_ideas = {
				remove_idea = PRC_oil_crash3
				add_idea = PRC_oil_crash4
			}
		}
		else_if = {
			limit = { 
				has_idea = PRC_oil_crash2 
			}
			swap_ideas = {
				remove_idea = PRC_oil_crash2
				add_idea = PRC_oil_crash3
			}
		}
		else_if = {
			limit = { 
				has_idea = PRC_oil_crash1
			}
			swap_ideas = {
				remove_idea = PRC_oil_crash1
				add_idea = PRC_oil_crash2
			}
		}
		if = {
			limit = {
				has_idea = GER_oil_crash5
			}
			remove_ideas = GER_oil_crash5
		}
		else_if = {
			limit = { 
				has_idea = GER_oil_crash4
			}
			swap_ideas = {
				remove_idea = GER_oil_crash4
				add_idea = GER_oil_crash5
			}
		}
		else_if = {
			limit = {
				has_idea = GER_oil_crash3
			}
			swap_ideas = {
				remove_idea = GER_oil_crash3
				add_idea = GER_oil_crash4
			}
		}
		else_if = {
			limit = { 
				has_idea = GER_oil_crash2 
			}
			swap_ideas = {
				remove_idea = GER_oil_crash2
				add_idea = GER_oil_crash3
			}
		}
		else_if = {
			limit = { 
				has_idea = GER_oil_crash1
			}
			swap_ideas = {
				remove_idea = GER_oil_crash1
				add_idea = GER_oil_crash2
			}
		}
		else_if = {
			limit = {
				NOT = {
					has_idea = PRC_oil_crash1
				}
			}
			#Prevents empty effects
			effect_tooltip = {
				swap_ideas = {
					remove_idea = PRC_oil_crash1
					add_idea = PRC_oil_crash2
				}
			}
		}
	}
	PRC_decrease_corrupt_bureaucracy = {
		if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy_negative2_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy_negative2_idea
				add_idea = PRC_corrupt_bureaucracy_negative1_idea
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy_negative1_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy_negative1_idea
				add_idea = PRC_corrupt_bureaucracy_idea
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy_idea
				add_idea = PRC_corrupt_bureaucracy2_idea
			}
		}		
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy2_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy2_idea
				add_idea = PRC_corrupt_bureaucracy3_idea
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy3_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy3_idea
				add_idea = PRC_corrupt_bureaucracy4_idea
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy4_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy4_idea
				add_idea = PRC_corrupt_bureaucracy5_idea
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy5_idea
			}
			remove_ideas = PRC_corrupt_bureaucracy5_idea
		}
	}
	PRC_increase_corrupt_bureaucracy = {
		if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy_negative1_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy_negative1_idea
				add_idea = PRC_corrupt_bureaucracy_negative2_idea
			}
		}	
		if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy_idea
				add_idea = PRC_corrupt_bureaucracy_negative1_idea
			}
		}
		if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy2_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy2_idea
				add_idea = PRC_corrupt_bureaucracy_idea
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy3_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy3_idea
				add_idea = PRC_corrupt_bureaucracy2_idea
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy4_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy4_idea
				add_idea = PRC_corrupt_bureaucracy3_idea
			}
		}		
		else_if = {
			limit = {
				has_idea = PRC_corrupt_bureaucracy5_idea
			}
			swap_ideas = {
				remove_idea = PRC_corrupt_bureaucracy5_idea
				add_idea = PRC_corrupt_bureaucracy4_idea
			}
		}
	}
	PRC_increase_comprehensive_transformation = {
	if = {
		limit = {
			NOT = {
				OR = {
					has_idea = PRC_comprehensive_transformation_1
					has_idea = PRC_comprehensive_transformation_2
					has_idea = PRC_comprehensive_transformation_3
					has_idea = PRC_comprehensive_transformation_4
					has_idea = PRC_comprehensive_transformation_5
					has_idea = PRC_comprehensive_transformation_6
				}
			}
		}
		add_ideas = PRC_comprehensive_transformation_1
	}
	else_if = {
		limit = {
			has_idea = PRC_comprehensive_transformation_1
		}
		swap_ideas = {
			remove_idea = PRC_comprehensive_transformation_1
			add_idea = PRC_comprehensive_transformation_2
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_comprehensive_transformation_2
		}
		swap_ideas = {
			remove_idea = PRC_comprehensive_transformation_2
			add_idea = PRC_comprehensive_transformation_3
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_comprehensive_transformation_3
		}
		swap_ideas = {
			remove_idea = PRC_comprehensive_transformation_3
			add_idea = PRC_comprehensive_transformation_4
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_comprehensive_transformation_4
		}
		swap_ideas = {
			remove_idea = PRC_comprehensive_transformation_4
			add_idea = PRC_comprehensive_transformation_5
		}
	}	
}
	PRC_increase_corona = {
		if = {
			limit = {
				has_idea = PRC_coronavirus_pandemic_idea4
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea4
				add_idea = PRC_coronavirus_pandemic_idea3
			}
		}
		else_if = {
			limit = { 
				has_idea = PRC_coronavirus_pandemic_idea3
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea3
				add_idea = PRC_coronavirus_pandemic_idea2
			}
		}
		else_if = {
			limit = {
				has_idea = PRC_coronavirus_pandemic_idea2
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea2
				add_idea = PRC_coronavirus_pandemic_idea1
			}
		}
		else_if = {
			limit = { 
				has_idea = PRC_coronavirus_pandemic_idea1 
			}
			swap_ideas = {
				remove_idea = PRC_coronavirus_pandemic_idea1
				add_idea = PRC_coronavirus_pandemic_idea
			}
		}
		else_if = {
			limit = { 
				has_idea = PRC_coronavirus_pandemic_idea
			}
			add_stability = -0.05
		}
		else = {
			add_ideas = PRC_coronavirus_pandemic_idea4
		}
	}

PRC_increase_new_religious_policy_idea = { #better
	if = {
		limit = {
			NOT = {
				OR = {
					has_idea = PRC_new_religious_policy_idea_negative_2
					has_idea = PRC_new_religious_policy_idea
					has_idea = PRC_new_religious_policy_idea2
					has_idea = PRC_new_religious_policy_idea3
					has_idea = PRC_new_religious_policy_idea4
					has_idea = PRC_new_religious_policy_idea5
					has_idea = PRC_new_religious_policy_idea6
				}
			}
		}
		add_ideas = PRC_new_religious_policy_idea
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea_negative_2
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea_negative_2
			add_idea = PRC_new_religious_policy_idea
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea
			add_idea = PRC_new_religious_policy_idea2
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea2
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea2
			add_idea = PRC_new_religious_policy_idea3
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea3
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea3
			add_idea = PRC_new_religious_policy_idea4
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea4
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea4
			add_idea = PRC_new_religious_policy_idea5
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea5
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea5
			add_idea = PRC_new_religious_policy_idea6
		}
	}
}

PRC_decrease_new_religious_policy_idea = { #worse
	if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea6
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea6
			add_idea = PRC_new_religious_policy_idea5
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea5
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea5
			add_idea = PRC_new_religious_policy_idea4
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea4
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea4
			add_idea = PRC_new_religious_policy_idea3
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea3
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea3
			add_idea = PRC_new_religious_policy_idea2
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea2
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea2
			add_idea = PRC_new_religious_policy_idea
		}
	}
	else_if = {
		limit = {
			has_idea = PRC_new_religious_policy_idea
		}
		swap_ideas = {
			remove_idea = PRC_new_religious_policy_idea
			add_idea = PRC_new_religious_policy_idea_negative_2
		}
	}
}
	
	#Influence Effects
	
	
	PRC_add_influence_nat = {
		custom_effect_tooltip = PRC_influence_nat_tooltip
		
		add_to_variable = {
			var = PRC_influence_nat_var
			value = PRC_influence_nat_var_temp
		}
		
		clamp_variable = {
			var = PRC_influence_nat_var
			min = 0
			max = 1
		}

		set_variable = {
			var = PRC_influence_nat_dynamic_var
			value = PRC_influence_nat_var
		}
		
		multiply_variable = {
			var = PRC_influence_nat_dynamic_var
			value = 0.1
		}
	}
	
	PRC_add_influence_cen = {
		custom_effect_tooltip = PRC_influence_cen_tooltip
		
		add_to_variable = {
			var = PRC_influence_cen_var
			value = PRC_influence_cen_var_temp
		}
		
		clamp_variable = {
			var = PRC_influence_cen_var
			min = 0
			max = 1
		}

		set_variable = {
			var = PRC_influence_cen_dynamic_var
			value = PRC_influence_cen_var
		}
		
		multiply_variable = {
			var = PRC_influence_cen_dynamic_var
			value = 0.2
		}
	}
	
	PRC_add_influence_new = {
		custom_effect_tooltip = PRC_influence_new_tooltip
		
		add_to_variable = {
			var = PRC_influence_new_var
			value = PRC_influence_new_var_temp
		}
		
		clamp_variable = {
			var = PRC_influence_new_var
			min = 0
			max = 1
		}

		set_variable = {
			var = PRC_influence_new_dynamic_var
			value = PRC_influence_new_var
		}
		
		multiply_variable = {
			var = PRC_influence_new_dynamic_var
			value = 0.2
		}
	}
	
	PRC_add_influence_lib = {
		custom_effect_tooltip = PRC_influence_lib_tooltip
		
		add_to_variable = {
			var = PRC_influence_lib_var
			value = PRC_influence_lib_var_temp
		}
		
		clamp_variable = {
			var = PRC_influence_lib_var
			min = 0
			max = 1
		}

		set_variable = {
			var = PRC_influence_lib_dynamic_var
			value = PRC_influence_lib_var
		}
		
		multiply_variable = {
			var = PRC_influence_lib_dynamic_var
			value = 0.2
		}
	}
	
	PRC_who_won_power_struggle = {
		if = {
			limit = {
				AND = {
					check_variable = { 
						PRC_influence_new_var > PRC_influence_lib_var
					}
					check_variable = { 
						PRC_influence_new_var > PRC_influence_aut_var 
					}
					check_variable = { 
						PRC_influence_new_var > PRC_influence_cen_var 
					}
					check_variable = { 
						PRC_influence_new_var > PRC_influence_nat_var 
					}
				}
			}
			set_country_flag = PRC_new_left_victory_flag
			country_event = {
				id = china.17
				days = 1
			}
		}
		else_if = {
			limit = {
				AND = {
					check_variable = { PRC_influence_lib_var > PRC_influence_new_var }
					check_variable = { PRC_influence_lib_var > PRC_influence_aut_var }
					check_variable = { PRC_influence_lib_var > PRC_influence_cen_var }
					check_variable = { PRC_influence_lib_var > PRC_influence_nat_var }
				}
			}
			set_country_flag = PRC_liberal_victory_flag
			country_event = {
				id = china.19
				days = 1
			}
		}
		else_if = {
			limit = {
				AND = {
					check_variable = { PRC_influence_aut_var > PRC_influence_new_var }
					check_variable = { PRC_influence_aut_var > PRC_influence_lib_var}
					check_variable = { PRC_influence_aut_var > PRC_influence_cen_var }
					check_variable = { PRC_influence_aut_var > PRC_influence_nat_var }
				}
			}
			set_country_flag = PRC_authoritarian_victory_flag
			country_event = {
				id = china.22
				days = 1
			}
		}
		else_if = {
			limit = {
				AND = {
					check_variable = { PRC_influence_cen_var > PRC_influence_new_var }
					check_variable = { PRC_influence_cen_var > PRC_influence_lib_var}
					check_variable = { PRC_influence_cen_var > PRC_influence_aut_var }
					check_variable = { PRC_influence_cen_var > PRC_influence_nat_var }
				}
			}
			set_country_flag = PRC_centrists_victory_flag
			country_event = {
				id = china.20
				days = 1
			}
		}
		else_if = {
			limit = {
				AND = {
					check_variable = { PRC_influence_nat_var > PRC_influence_new_var }
					check_variable = { PRC_influence_nat_var > PRC_influence_lib_var}
					check_variable = { PRC_influence_nat_var > PRC_influence_aut_var }
					check_variable = { PRC_influence_nat_var > PRC_influence_cen_var }
				}
			}
			set_country_flag = PRC_nationalist_victory_flag
			country_event = {
				id = china.21
				days = 1
			}
		}
		else = {
			add_political_power = 2000
		}
	}
	
	#SE Asia
	PRC_add_CAM_influence = {
		custom_effect_tooltip = PRC_add_CAM_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_CAM_var 
			value = global.PRC_influence_CAM_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_CAM_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_CAM_influence = {
		custom_effect_tooltip = PRC_subtract_CAM_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_CAM_var 
			value = global.PRC_influence_CAM_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_CAM_var
			min = 0
			max = 1
		}
	}
	PRC_add_INS_influence = {
		custom_effect_tooltip = PRC_add_INS_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_INS_var 
			value = global.PRC_influence_INS_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_INS_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_INS_influence = {
		custom_effect_tooltip = PRC_subtract_INS_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_INS_var 
			value = global.PRC_influence_INS_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_INS_var
			min = 0
			max = 1
		}
	}
	PRC_add_LAO_influence = {
		custom_effect_tooltip = PRC_add_LAO_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_LAO_var 
			value = global.PRC_influence_LAO_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_LAO_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_LAO_influence = {
		custom_effect_tooltip = PRC_subtract_LAO_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_LAO_var 
			value = global.PRC_influence_LAO_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_LAO_var
			min = 0
			max = 1
		}
	}
	PRC_add_MAL_influence = {
		custom_effect_tooltip = PRC_add_MAL_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_MAL_var 
			value = global.PRC_influence_MAL_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_MAL_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_MAL_influence = {
		custom_effect_tooltip = PRC_subtract_MAL_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_MAL_var 
			value = global.PRC_influence_MAL_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_MAL_var
			min = 0
			max = 1
		}
	}
	PRC_add_BRM_influence = {
		custom_effect_tooltip = PRC_add_BRM_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_BRM_var 
			value = global.PRC_influence_BRM_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_BRM_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_BRM_influence = {
		custom_effect_tooltip = PRC_subtract_BRM_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_BRM_var 
			value = global.PRC_influence_BRM_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_BRM_var
			min = 0
			max = 1
		}
	}
	PRC_add_PHI_influence = {
		custom_effect_tooltip = PRC_add_PHI_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_PHI_var 
			value = global.PRC_influence_PHI_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_PHI_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_PHI_influence = {
		custom_effect_tooltip = PRC_subtract_PHI_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_PHI_var 
			value = global.PRC_influence_PHI_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_PHI_var
			min = 0
			max = 1
		}
	}
	PRC_add_SIG_influence = {
		custom_effect_tooltip = PRC_add_SIG_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_SIG_var 
			value = global.PRC_influence_SIG_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_SIG_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_SIG_influence = {
		custom_effect_tooltip = PRC_subtract_SIG_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_SIG_var 
			value = global.PRC_influence_SIG_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_SIG_var
			min = 0
			max = 1
		}
	}
	PRC_add_SIA_influence = {
		custom_effect_tooltip = PRC_add_SIA_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_SIA_var 
			value = global.PRC_influence_SIA_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_SIA_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_SIA_influence = {
		custom_effect_tooltip = PRC_subtract_SIA_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_SIA_var 
			value = global.PRC_influence_SIA_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_SIA_var
			min = 0
			max = 1
		}
	}
	PRC_add_VIN_influence = {
		custom_effect_tooltip = PRC_add_VIN_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_VIN_var 
			value = global.PRC_influence_VIN_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_VIN_var
			min = 0
			max = 1
		}
	}
	PRC_subtract_VIN_influence = {
		custom_effect_tooltip = PRC_subtract_VIN_influence_tt
		
		add_to_variable = {
			var = global.PRC_influence_VIN_var 
			value = global.PRC_influence_VIN_var_temp
		}
		
		clamp_variable = {
			var = global.PRC_influence_VIN_var
			min = 0
			max = 1
		}
	}
	
	PRC_increase_war_exhaustion = {
		add_to_variable = {
			PRC_war_exhaustion_war_support_factor_dynamic = -0.015
		}
		add_to_variable = {
			PRC_war_exhaustion_army_attack_factor_dynamic = -0.015
		}
		add_to_variable = {
			PRC_war_exhaustion_army_defence_factor_dynamic = -0.015
		}
		add_to_variable = {
			PRC_war_exhaustion_army_org_factor_dynamic = -0.01
		}
		add_to_variable = {
			PRC_war_exhaustion_army_morale_factor_dynamic = -0.02
		}
		add_to_variable = {
			PRC_war_exhaustion_surrender_limit_dynamic = -0.005
		}
		effect_tooltip = {
			swap_ideas = {
				remove_idea = PRC_war_exhaustion
				add_idea = PRC_war_exhaustion2
			}
		}
	}

	PRC_japans_victory_in_the_gaw = {
		set_global_flag = PRC_japanese_gaw_victory_global
		set_country_flag = GAW_disabled
		clr_global_flag = pan_asian_war_ongoing
		every_state = {
			limit = {
				state_population > 500000
				OR = {
					region = 155
					region = 152
					region = 143
					region = 164
					region = 220
					region = 144
					region = 165
					region = 216
					region = 219
					region = 200
					region = 155
					region = 155
				}
			}
			set_state_flag = PRC_state_for_unification_of_china
			add_to_array = {
				array = PRC.coreable_states_capitals
				value = THIS.id
			}
		}
		PRC = {
			set_temp_variable = {
				var = debt_var_temp
				value = -50000
			}
			add_debt = yes
			PRC_remove_special_regional_modifiers = yes
			load_focus_tree = generic_focus
			country_event = {
				id = china.247
				days = 1
			}
			remove_dynamic_modifier = {
				modifier = PRC_communist_party_of_china_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_national_peoples_congress_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_made_in_china_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_chinese_space_age_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_made_in_china_new_left_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_chinese_enviroment_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_pla_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_plan_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_plaaf_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_chinese_reforms_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_econ_engine_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_overloaded_bureaucracy_dynamic
			}
			remove_dynamic_modifier = {
				modifier = PRC_BRI_dynamic
			}
			remove_ideas = {
				PRC_chinese_enviroment_idea
				PRC_chinese_communist_party_idea
				PRC_corrupt_bureaucracy_negative2_idea
				PRC_corrupt_bureaucracy_negative1_idea
				PRC_corrupt_bureaucracy_idea
				PRC_corrupt_bureaucracy1_idea
				PRC_corrupt_bureaucracy2_idea
				PRC_corrupt_bureaucracy3_idea
				PRC_corrupt_bureaucracy4_idea
				PRC_corrupt_bureaucracy5_idea
				PRC_the_separatist_problem
				PRC_the_separatist_problem_2
				PRC_the_separatist_problem_3
				PRC_the_separatist_problem_4
				PRC_one_heart_idea
				PRC_one_heart_idea_1
				PRC_one_heart_idea_2
				PRC_socialist_chinese_dream_idea
				PRC_socialist_chinese_dream_idea1
				PRC_socialist_chinese_dream_idea2
				PRC_Hundred_Flower_Campaign_idea
				PRC_five_stars_shines_over_china_idea
				PRC_chinese_interventionism
				PRC_deus_ex_machina_idea
				PRC_food_safety_reforms_idea
				PRC_coordinate_eadi_militaries_idea
			}
			set_politics = {
				ruling_party = nationalist
				last_election = "2019.6.5"
				election_frequency = 48
				elections_allowed = no
			}
			set_popularities = {
				social_democrat = 20
				market_liberal = 3
				communist = 25
				social_liberal = 7
				nationalist = 45
			}
			country_event = {
				id = china.1003
				days = 20
			}
		}
		set_global_flag = PRC_china_collapse
		news_event = news.414
		if = {
			limit = {
				has_global_flag = PRC_taiwan_war_lost
			}
			CHI = {
				transfer_state = 1218
				transfer_state = 1382
				transfer_state = 879
			}	
		}
		else = {
			CHI = {
				transfer_state = 1218
				transfer_state = 1382
				transfer_state = 879
				transfer_state = 1148
				transfer_state = 1149
				transfer_state = 1150
				transfer_state = 524
				transfer_state = 1451
			}
		}
		CHI = {
			transfer_state = 591
			transfer_state = 728
			if = {
				limit = {
					has_country_flag = CHI_DPP_in_power_flag
				}
				country_event = { id = taiwan.18 days = 10 }
			}
			if = {
				limit = {
					has_country_leader = {
					    character = CHI_han_kuo_yu_char 
					    ruling_only = yes 
				    }
				}
				set_country_leader_portrait = {
					ideology = conservative
					portrait = GFX_portrait_CHI_han_kuo_yu_gaw_win
				}
			}
		}
		if = {
			limit = {
				CHI = {
					OR = {
						has_cosmetic_tag = CHI_PRC_puppet
						has_cosmetic_tag = PRC_military_administration
					}
				}
			}
			PRC = {
				end_puppet = CHI
			}
			CHI = {
				drop_cosmetic_tag = yes
			}
			JAP = { 
				add_to_faction = CHI
				puppet = CHI
			}
		}
		if = {
			limit = {
				has_global_flag = pdto_captured_guangzhou
			}
			CHI = {	
				#transfer_state = 1191
				transfer_state = 592
			}
		}
		if = {
			limit = {
				has_global_flag = pdto_captured_hong_kong
			}
			CHI = {	
				transfer_state = 1395
				transfer_state = 326
				transfer_state = 729
			}
		}
		if = {
			limit = {
				has_global_flag = pdto_captured_fuzhou
			}
			CHI = {	
				transfer_state = 595
				transfer_state = 1217
				transfer_state = 1219
			}
		}
		if = {
			limit = {
				has_global_flag = battle_of_shanghai
			}
			JAP = {	
				transfer_state = 1215
			}
		}
		if = {
			limit = {
				has_global_flag = battle_of_nanjing
			}
			JAP = {	
				transfer_state = 613
			}
		}
		if = {
			limit = {
				OR = {
					has_global_flag = pdto_captured_qingdao
					has_global_flag = pdto_captured_tianjin
					has_global_flag = battle_of_beijing
				}
			}
			JAP = {	
				transfer_state = 1393
			}
		}
		if = {
			limit = {
				has_global_flag = pdto_captured_qingdao
			}
			JAP = {	
				transfer_state = 1420
			}
		}
		if = {
			limit = {
				OR = {
					has_global_flag = pdto_captured_tianjin
					has_global_flag = battle_of_beijing
					has_global_flag = pdto_entered_manchuria
				}
			}
			JAP = {	
				transfer_state = 1394
			}
		}
		if = {
			limit = {
				OR = {
					has_global_flag = pdto_captured_tianjin
					has_global_flag = battle_of_beijing
				}
			}
			JAP = {	
				transfer_state = 1157
				transfer_state = 609
			}
		}
		#if = {
		#	limit = {
		#		CHI = {
		#			controls_state = 595
		#			controls_state = 1395
		#			controls_state = 592
		#		}
		#	}
		#	CHI = {	
		#		transfer_state = 1216
		#		transfer_state = 1206
		#	}
		#}
		if = {
			limit = {
				has_global_flag = pdto_takes_1413_1414			
			}
			PD1 = {	transfer_state = 1413 }
			PD1 = {	transfer_state = 1414 }
			PD1 = {	transfer_state = 1417 }
		}
		if = {
			limit = {
				has_global_flag = pdto_takes_1415
			}
			PD1 = {	transfer_state = 1415 }
			PD1 = {	transfer_state = 1416 }
		}
		JAP = {
			add_to_faction = PD1
		}
		KOR = {
			annex_country = {
    			target = PRK
    			transfer_troops = no
			}
			drop_cosmetic_tag = yes
		}
		if = {
			limit = {
				NOT = {
					has_global_flag = RAJ_india_dead
				}
			}
			1380 = { transfer_state_to = RAJ }
			440 = { transfer_state_to = RAJ }
			443 = { transfer_state_to = RAJ }
			1132 = { transfer_state_to = RAJ }
			787 = { transfer_state_to = RAJ }
			788 = { transfer_state_to = RAJ }
			1131 = { transfer_state_to = RAJ }
			441 = { transfer_state_to = RAJ }
			RAJ = { end_puppet = SIK }
			SIK = {
				white_peace = PRC
				leave_faction = yes
			}
			RAJ = {
				puppet = PAK
				puppet = NEP
				puppet = BHU
				if = {
					limit = {
						has_global_flag = BRM_prochinese_asian_cold_war
					}
					puppet = BRM
				}
				annex_country = {
    				target = SRL
    				transfer_troops = no
				}
				annex_country = {
    				target = SAJ
    				transfer_troops = no
				}
				set_country_flag = GAW_disabled
			}
			every_state = {
				limit = {
					is_core_of = RAJ
					NOT = {
						is_controlled_by = RAJ
					}
				}
				transfer_state_to = RAJ
			}
			PAK = {
				set_cosmetic_tag = RAJ_military_administration
				set_politics = {
					ruling_party = nationalist
					elections_allowed = no
				}
				set_popularities = {
					nationalist = 50
					authoritarian_democrat = 10
					national_socialist = 20
					market_liberal = 5
					social_liberal = 15
				}
				set_country_leader_name = {
					ideology = nationalist
					name = RAJ_indian_military_command
				}
				set_country_leader_portrait = {
					ideology = nationalist
					portrait = GFX_portrait_RAJ_indian_military_command
				}
				set_country_leader_ideology = military_junta
			}
			NEP = {
				set_cosmetic_tag = RAJ_military_administration
				set_politics = {
					ruling_party = nationalist
					elections_allowed = no
				}
				set_popularities = {
					nationalist = 50
					authoritarian_democrat = 10
					national_socialist = 20
					market_liberal = 5
					social_liberal = 15
				}
				set_country_leader_name = {
					ideology = nationalist
					name = RAJ_indian_military_command
				}
				set_country_leader_portrait = {
					ideology = nationalist
					portrait = GFX_portrait_RAJ_indian_military_command
				}
				set_country_leader_ideology = military_junta
			}
			BHU = {
				set_cosmetic_tag = RAJ_military_administration
				set_politics = {
					ruling_party = nationalist
					elections_allowed = no
				}
				set_popularities = {
					nationalist = 50
					authoritarian_democrat = 10
					national_socialist = 20
					market_liberal = 5
					social_liberal = 15
				}
				set_country_leader_name = {
					ideology = nationalist
					name = RAJ_indian_military_command
				}
				set_country_leader_portrait = {
					ideology = nationalist
					portrait = GFX_portrait_RAJ_indian_military_command
				}
				set_country_leader_ideology = military_junta
			}
			if = {
				limit = {
					has_global_flag = BRM_prochinese_asian_cold_war
				}
				BRM = {
					set_cosmetic_tag = RAJ_military_administration
					set_politics = {
						ruling_party = nationalist
						elections_allowed = no
					}
					set_popularities = {
						nationalist = 50
						authoritarian_democrat = 10
						national_socialist = 20
						market_liberal = 5
						social_liberal = 15
					}
					set_country_leader_name = {
						ideology = nationalist
						name = RAJ_indian_military_command
					}
					set_country_leader_portrait = {
						ideology = nationalist
						portrait = GFX_portrait_RAJ_indian_military_command
					}
					set_country_leader_ideology = military_junta
				}
			}
		}
		if = {
			limit = {
				has_global_flag = RAJ_india_dead
			}
			PRC = {
				end_puppet = PRJ
			}
			PRJ = {
				transfer_state = 434
				add_state_core = 434
				get_current_government_type = yes
				set_cosmetic_tag = PRJ_pakistan_administration
			}
			PAK = {
				puppet = PRJ
			}
			PRJ = {
				restore_previous_government_type = yes
			}
		}
		JAP = {
			end_puppet = PRC
			add_to_faction = CHI
			country_event = {
				id = jap.1003
				days = 7
			}
			country_event = {
				id = jap.149
				days = 14
				random_days = 7
			}
			country_event = {
				id = jap.150
				days = 20
				random_days = 20
			}
			set_country_flag = GAW_disabled
			country_event = {
				id = jap.168
				days = 40
				random_days = 5
			}
		}
		AST = {
			set_country_flag = GAW_disabled
		}
		every_country = {
			limit = {
				has_country_flag = eadi_member
			}
			clr_country_flag = eadi_member
		}
		every_country = {
			limit = {
				is_ally_with = JAP
			}
			set_country_flag = pdto_member
		}
	}

	PRC_chinas_victory_in_the_gaw = {
		clr_global_flag = pan_asian_war_ongoing
		set_global_flag = PRC_chinese_gaw_victory_global
		PRC_dissolve_japan = yes
		PRC_dissolve_india = yes
		PRC = {
			annex_country = {
    			target = CHI
    			transfer_troops = no
			}
			add_state_core = 1150
			add_state_core = 524
			add_state_core = 1149
			add_state_core = 1148
			add_state_core = 1451
			if = {
				limit = {
					has_country_leader = {
						character = PRC_xi_jinping
						ruling_only = yes
					}
				}
				set_country_leader_portrait = {
					ideology = communist
					portrait = GFX_portrait_PRC_xi_jinping_gaw_win
				}
			}
			if = {
				limit = {
					has_country_flag = PRC_centrist_win
				}
				country_event = { id = china.2000 days = 45 }
				country_event = { id = china.1506 days = 5 }
				country_event = { id = china.1507 days = 10 }
				country_event = { id = china.1508 days = 15 }
				country_event = { id = china.1509 days = 20 }
				country_event = { id = china.1510 days = 25 }
				country_event = { id = china.1514 days = 30 }
				country_event = { id = china.1515 days = 35 }
				country_event = { id = china.1516 days = 40 }
			}
			#if = {
			#	limit = {
			#		has_country_flag = PRC_nationalist_win
			#	}
			#	country_event = { id = china.2001 days = 3 }
			#}
			if = {
				limit = {
					has_country_flag = PRC_liberal_win
				}
				country_event = { id = china.2002 days = 3 }
			}
			if = {
				limit = {
					has_country_flag = PRC_new_left_win
				}
				country_event = { id = china.2003 days = 3 }
			}
		}
		PRK = {
			annex_country = {
    			target = KOR
    			transfer_troops = no
			}
		}
		NEP = {
			set_cosmetic_tag = PRC_military_administration
			JAP_leave_PEC = yes
		}
		BHU = {
			set_cosmetic_tag = PRC_military_administration
			JAP_leave_PEC = yes
		}
	}
	
	PRC_chinas_victory_in_the_gaw_allies = {
		set_global_flag = PRC_chinese_gaw_victory_global
		PRC = {
			if = {
				limit = {
					has_completed_focus = PRC_under_the_rule_of_the_great_entity
				}
				set_country_flag = PRC_loji_united_asia
			}
			if = {
				limit = {
					has_country_flag = PRC_nationalist_win
				}
				country_event = {
					id = china.1033
					hours = 3
				}
			}
		}
		news_event = {
			id = news.413
			days = 0
		}
		PRC = {
			annex_country = {
    			target = CHI
    			transfer_troops = no
			}
			add_state_core = 1150
			add_state_core = 524
			add_state_core = 1149
			add_state_core = 1148
			add_state_core = 1451
			country_event = {
				id = china.333
				days = 50
			}
		}
		PRK = {
			annex_country = {
    			target = KOR
    			transfer_troops = no
			}
		}
		#NEP = {
		#	set_cosmetic_tag = PRC_military_administration
		#}
		#BHU = {
		#	set_cosmetic_tag = PRC_military_administration
		#}
		if = {
			limit = {
				VIN = {
					is_puppet_of = PRC
				}
			}
			VIN = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = communist
					elections_allowed = no
				}
				set_popularities = {
					totalitarian_socialist = 5
					libertarian_socialist = 10
					social_democrat = 5
					communist = 80
				}
			}
		}
		if = {
			limit = {
				LAO = {
					is_puppet_of = PRC
				}
			}
			LAO = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = communist
					elections_allowed = no
				}
				set_popularities = {
					totalitarian_socialist = 3
					libertarian_socialist = 2
					social_democrat = 2
					communist = 93
				}
			}
		}
		if = {
			limit = {
				CAM = {
					is_puppet_of = PRC
				}
			}
			CAM = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = authoritarian_democrat
					elections_allowed = no
				}
				set_popularities = {
					communist = 10
					conservative = 6
					social_democrat = 12
					authoritarian_democrat = 72
				}
			}
		}
		if = {
			limit = {
				SIA = {
					is_puppet_of = PRC
				}
			}
			SIA = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = communist
					elections_allowed = no
				}
				set_popularities = {
					conservative = 5
					authoritarian_democrat = 19
					market_liberal = 2
					social_democrat = 10
					nationalist = 5
					communist = 59
				}
			}
		}
		if = {
			limit = {
				INS = {
					is_puppet_of = PRC
				}
			}
			INS = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = authoritarian_democrat
					elections_allowed = no
				}
				set_popularities = {
					totalitarian_socialist = 3
					libertarian_socialist = 10
					social_democrat = 12
					social_liberal = 15
					authoritarian_democrat = 60
				}
			}
		}
		if = {
			limit = {
				MAL = {
					is_puppet_of = PRC
				}
			}
			MAL = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = authoritarian_democrat
					elections_allowed = no
				}
				set_popularities = {
					totalitarian_socialist = 3
					libertarian_socialist = 10
					social_democrat = 12
					social_liberal = 15
					authoritarian_democrat = 60
				}
			}
		}
		if = {
			limit = {
				PHI = {
					is_puppet_of = PRC
				}
			}
			PHI = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = totalitarian_socialist
					elections_allowed = no
				}
				set_popularities = {
					totalitarian_socialist = 77
					conservative = 10
					social_democrat = 10
					fascist = 3
				}
				create_country_leader = {
					name = NPA_luis_jalandoni_char
					picture = "gfx/leaders/PHI/Luis_Jalandoni.png"
					ideology = left_wing_junta
				}
			}
		}
		if = {
			limit = {
				AST = {
					is_puppet_of = PRC
				}
			}
			AST = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = libertarian_socialist
					elections_allowed = no
				}
				set_popularities = {
					conservative = 8
					libertarian_socialist = 52
					market_liberal = 25
					nationalist = 15
				}
			}
		}
		if = {
			limit = {
				PNG = {
					is_puppet_of = PRC
				}
			}
			PNG = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = conservative
					elections_allowed = no
				}
				set_popularities = {
					conservative = 55
					market_liberal = 35
					authoritarian_democrat = 1
					nationalist = 1
					market_liberal = 2
					social_liberal = 2
					communist = 4
				}
			}
		}
		if = {
			limit = {
				NZL = {
					is_puppet_of = PRC
				}
			}
			NZL = {
				drop_cosmetic_tag = yes
				set_politics = {
					ruling_party = social_democrat
					elections_allowed = no
				}
				set_popularities = {
					conservative = 30
					social_democrat = 35
					authoritarian_democrat = 17
					nationalist = 3
					market_liberal = 5
					social_liberal = 3
					communist = 7
				}
			}
		}
		every_country = {
			limit = {
				has_country_flag = pdto_member
			}
			clr_country_flag = pdto_member
		}
		every_country = {
			limit = {
				is_ally_with = PRC
			}
			clr_country_flag = JAP_PEC_member_flag
			set_country_flag = eadi_member
			remove_ideas = {
				JAP_PDTO_member_1
				JAP_PDTO_member_2
				JAP_PEC_member
				JAP_PEC_member_2
			}
		}
	}

	PRC_end_taiwan_war = {
		clr_global_flag = PRC_ongoing_taiwan_war
		white_peace = AST
		white_peace = JAP
		annex_country = {
		    target = HKN
		    transfer_troops = no
		}
		326 = {
			add_dynamic_modifier = {
				modifier = PRC_hong_kong
			}
		}
		country_event = {
			id = china.250
			days = 120
		}
		country_event = {
			id = china.254
			days = 200
		}
		clr_global_flag = battle_of_okinawa
		every_state = { #защита от дебила
			limit = {
				is_owned_by = JAP
				NOT = {
					OR = {
						state = 526
						state = 876
					}
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_non_combat_area
				scope = PRC #потом скоупы поменять
			}
		}
		every_state = { #защита от дебила
			limit = {
				is_owned_by = AST
			}
			remove_dynamic_modifier = {
				modifier = PRC_non_combat_area
				scope = PRC
			}
		}
		every_state = { #защита от дебила
			limit = {
				is_owned_by = PRC
				is_coastal = yes
				NOT = {
					OR = {
						state = 326
						state = 648
					}
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_non_combat_area
			}
		}
		AST = {
			country_event = Australia.18
		}
		JAP = {
			if = {
				limit = {
					OR = {
						has_idea = low_society
						has_idea = lower_society
					}
				}
				add_ideas = medium_society
				set_temp_variable = {
					var = society_development_var_temp
					value = 0.25
				}
				add_society_development = yes
			}
		}
	}
	
	PRC_dissolve_japan = {
		every_state = {
			limit = {
				is_core_of = JAP
			}
			remove_core_of = JAP
		}
		PRC = {
			transfer_state = 1341
			transfer_state = 876
			transfer_state = 1338
			transfer_state = 526
			transfer_state = 645
			puppet = TOK
		}
		TOK = {
			transfer_state = 1332
			add_state_core = 1332
			create_faction = PRC_yokohama_treaty_organisation_faction
			hidden_effect = {
				remove_faction_goal = faction_goal_the_atomic_race
				add_faction_goal = faction_goal_placeholder_long_term
				remove_faction_goal = faction_goal_a_military_base
				add_faction_goal = faction_goal_placeholder_medium_term
				add_faction_goal = faction_goal_placeholder_short_term
			}
			hidden_effect = {
				puppet = CGK
				puppet = KYU
				puppet = HOK
				puppet = SHK
				puppet = KTO
				puppet = CHB
				puppet = KSI
				puppet = TOH
				puppet = OSA
				puppet = NAG
				puppet = SNI
				add_to_faction = CGK
				add_to_faction = KYU
				add_to_faction = HOK
				add_to_faction = SHK
				add_to_faction = KSI
				add_to_faction = OSA
				add_to_faction = CHB
				add_to_faction = NAG
				add_to_faction = KTO
				add_to_faction = TOH
				add_to_faction = SNI
				set_politics = {
					ruling_party = libertarian_socialist
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					social_liberal = 24.5
					conservative = 20.8
					nationalist = 17.1
					libertarian_socialist = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		CGK = {
			transfer_state = 529
			add_state_core = 529
			hidden_effect = {
				set_politics = {	
					ruling_party = conservative
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					social_liberal = 24.5
					nationalist = 20.8
					communist = 17.1
					conservative = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		KYU = {
			transfer_state = 528
			add_state_core = 528
			hidden_effect = {
				set_politics = {	
					ruling_party = conservative
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					social_liberal = 24.5
					social_democrat = 20.8
					communist = 17.1
					conservative = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		HOK = {
			transfer_state = 536
			transfer_state = 1333
			transfer_state = 1334
			add_state_core = 536
			add_state_core = 1333
			add_state_core = 1334
			hidden_effect = {
				set_politics = {	
					ruling_party = social_liberal
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					market_liberal = 24.5
					conservative = 20.8
					nationalist = 17.1
					social_liberal = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		SHK = {
			transfer_state = 530
			add_state_core = 530
			hidden_effect = {
				set_politics = {	
					ruling_party = libertarian_socialist
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					social_liberal = 24.5
					social_democrat = 20.8
					communist = 17.1
					libertarian_socialist = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		KSI = {
			transfer_state = 531
			add_state_core = 531
			hidden_effect = {
				set_politics = {	
					ruling_party = market_liberal
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					nationalist = 24.5
					conservative = 20.8
					communist = 17.1
					market_liberal = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		OSA = {
			transfer_state = 1340
			add_state_core = 1340
			hidden_effect = {
				set_politics = {
					ruling_party = market_liberal
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					social_liberal = 24.5
					conservative = 20.8
					nationalist = 17.1
					market_liberal = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		CHB = {
			transfer_state = 532
			transfer_state = 535
			transfer_state = 534
			add_state_core = 532
			add_state_core = 535
			add_state_core = 534
			hidden_effect = {
				set_politics = {	
					ruling_party = authoritarian_democrat
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					conservative = 10
					nationalist = 4
					authoritarian_democrat = 86
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		NAG = {
			transfer_state = 1337
			add_state_core = 1337
			hidden_effect = {
				set_politics = {	
					ruling_party = conservative
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					social_liberal = 24.5
					conservative = 20.8
					nationalist = 17.1
					communist = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		KTO = {
			transfer_state = 282
			add_state_core = 282
			hidden_effect = {
				set_politics = {	
					ruling_party = social_liberal
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					libertarian_socialist = 24.5
					conservative = 20.8
					social_liberal = 54.7
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		TOH = {
			transfer_state = 533
			transfer_state = 1336
			add_state_core = 533
			add_state_core = 1336
			hidden_effect = {
				set_politics = {	
					ruling_party = conservative
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					social_liberal = 24.5
					market_liberal = 20.8
					social_democrat = 17.1
					conservative = 37.6
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
		SNI = {
			transfer_state = 1335
			add_state_core = 1335
			hidden_effect = {
				set_politics = {	
					ruling_party = social_liberal
					last_election = "2017.10.22"
					election_frequency = 48
					elections_allowed = no
				}
				set_popularities = {
					communist = 24.5
					libertarian_socialist = 17.1
					social_liberal = 58.4
				}
				add_ideas = JAP_dejapanization_idea
			}
		}
	}
	
	PRC_dissolve_india = {
		news_event = {
			id = RAJ.26
			days = 2
		}
		RAJ = {
			#diplomatic_relation = {
			#	country = BHU
			#	relation = guarantee
			#	active = no
			#}
			#diplomatic_relation = {
			#	country = SRL
			#	relation = guarantee
			#	active = no
			#}
			#diplomatic_relation = {
			#	country = NEP
			#	relation = guarantee
			#	active = no
			#}
			every_state = {
				limit = {
					is_core_of = RAJ
				}
				remove_core_of = RAJ
				add_claim_by = RAJ
				add_claim_by = NAX
				add_claim_by = RSS
				add_claim_by = LRJ
			}
			if = {
				limit = {
					owns_state = 430
				}
				PRJ = {
					transfer_state = 430
					transfer_state = 431
					transfer_state = 1369
				}
			}
			country_event = {
				id = RAJ.3
				days = 10
			}
			random_list = {
				25 = {
					country_event = {
						id = RAJ.10
						days = 3
					}
				}
				25 = {
					country_event = {
						id = RAJ.14
						days = 3
					}
				}
				25 = {
					country_event = {
						id = RAJ.12
						days = 3
					}
				}
				25 = {
					country_event = {
						id = RAJ.15
						days = 3
					}
				}
			}
			remove_ideas = RAJ_very_high_population_density
			teleport_armies = {
				to_state_array = owned_controlled_states
			}
		}
		if = {
			limit = {
				NOT = {
					PAK = {
						has_idea = PRC_ASIA_chinese_purification_zone_idea
					}
				}
			}
			PRJ = {
				transfer_state = 432
				transfer_state = 1367
				transfer_state = 789
				transfer_state = 437
				transfer_state = 1370
				transfer_state = 1397
				transfer_state = 1398
				transfer_state = 1366
				transfer_state = 1368
				add_state_core = 432
				add_state_core = 1367
				add_state_core = 789
				add_state_core = 437
				add_state_core = 1370
				add_state_core = 1397
				add_state_core = 1398
				add_state_core = 1366
				add_state_core = 1368
				load_oob = "PRJ_civil_war"
				set_capital = { state = 1397 }
			}
		}
		else = {
			PAK = {
				transfer_state = 432
				transfer_state = 1367
				transfer_state = 789
				transfer_state = 437
				transfer_state = 1370
				transfer_state = 1397
				transfer_state = 1398
				transfer_state = 1366
				transfer_state = 1368
				add_state_core = 432
				add_state_core = 1367
				add_state_core = 789
				add_state_core = 437
				add_state_core = 1370
				add_state_core = 1397
				add_state_core = 1398
				add_state_core = 1366
				add_state_core = 1368
			}
		}
		PRC = {
			country_event = china.456
			puppet = PRJ
			transfer_state = 434
			add_state_core = 434
			annex_country = {
    			target = TIB
    			transfer_troops = no
			}
			annex_country = {
    			target = SIK
    			transfer_troops = no
			}
		}
		PRJ = {
			set_politics = {	
				ruling_party = nationalist
				last_election = "2016.11.8"
				election_frequency = 48
				elections_allowed = no
			}

			set_popularities = {
				totalitarian_socialist = 33
				nationalist = 34
				libertarian_socialist = 33
			}
		}
		PAK = {
			transfer_state = 439
			transfer_state = 441
			transfer_state = 1381
			transfer_state = 1373
			transfer_state = 1131
			transfer_state = 787
			transfer_state = 443
			add_state_core = 439
			add_state_core = 441
			add_state_core = 1381
			annex_country = {
			    target = SAJ
			    transfer_troops = no
			}
		}
		LRJ = {
			transfer_state = 433
			transfer_state = 428
			433 = {
				add_core_of = LRJ
			}
			428 = {
				add_core_of = LRJ
			}
			add_ideas = RAJ_indian_civil_war_idea
			set_capital = { state = 428 }
			give_military_access = PRC
			give_military_access = PAK
		}
		MPJ = {
			transfer_state = 436
			transfer_state = 1399
			transfer_state = 1400
			436 = {
				add_core_of = MPJ
			}
			1399 = {
				add_core_of = MPJ
			}
			1400 = {
				add_core_of = MPJ
			}
			add_ideas = RAJ_indian_civil_war_idea
			set_capital = { state = 436 }
		}
		UPJ = {
			transfer_state = 438
			438 = {
				add_core_of = MPJ
			}
			add_ideas = RAJ_indian_civil_war_idea
			set_capital = { state = 438 }
			give_military_access = PRC
			give_military_access = PAK
		}
		SAJ = {
			drop_cosmetic_tag = yes
			clr_country_flag = eadi_member
			clr_country_flag = pdto_member
			remove_ideas = {
				PRC_coordinate_eadi_militaries_idea
				JAP_PDTO_member_1
				JAP_PDTO_member_2
				JAP_PEC_member
				JAP_PEC_member_2
			}
			transfer_state = 429
			transfer_state = 427
			transfer_state = 424
			add_ideas = RAJ_indian_civil_war_idea
			429 = {
				add_core_of = SAJ
			}
			427 = {
				add_core_of = SAJ
			}
			424 = {
				add_core_of = SAJ
			}
			set_capital = { state = 429 }
			give_military_access = PRC
			give_military_access = PAK
		}
		DRV = {
			transfer_state = 423
			transfer_state = 320
			transfer_state = 1418
			load_oob = "DRV_civil_war"
			423 = {
				add_core_of = DRV
			}
			320 = {
				add_core_of = DRV
			}
			1418 = {
				add_core_of = DRV
			}
			add_ideas = RAJ_indian_civil_war_idea
			give_military_access = PRC
			give_military_access = PAK
		}
		RSS = {
			transfer_state = 425
			425 = {
				add_core_of = RSS
			}
			add_ideas = RAJ_indian_civil_war_idea
			add_ideas = RAJ_rising_hindu_nationalism_idea
			set_capital = { state = 425 }
			give_military_access = PRC
			give_military_access = PAK
		}
		NAX = {
			transfer_state = 435
			transfer_state = 1372
			transfer_state = 1371
			1372 = {
				add_core_of = NAX
			}
			435 = {
				add_core_of = NAX
			}
			1371 = {
				add_core_of = NAX
			}
			load_oob = "NAX_civil_war"
			add_ideas = RAJ_indian_civil_war_idea
			add_ideas = NAX_insurgency_idea
			give_military_access = PRC
			give_military_access = PAK
		}
		SLJ = {
			transfer_state = 426
			426 = {
				add_core_of = SLJ
			}
			load_oob = "SLJ_civil_war"
			add_ideas = RAJ_indian_civil_war_idea
			give_military_access = PRC
			give_military_access = PAK
		}
		BAN = {
			if = {
				limit = {
					owns_state = 430
					NOT = {
						has_war_with = PRC
					}
				}
				transfer_state = 431
				transfer_state = 1369
				give_military_access = PRC
				give_military_access = PAK
			}
		}
		RJN = {
			transfer_state = 281
			transfer_state = 321
			transfer_state = 733
			321 = {
				add_core_of = RJN
			}
			add_ideas = RAJ_indian_civil_war_idea
			set_capital = { state = 321 }
		}
		if = {
			limit = {
				RAJ = {
					has_idea = RAJ_destroyed_country
				}
			}
			every_country = {
				limit = {
					OR = {
						tag = UPJ
						tag = MPJ
						tag = LRJ
						tag = NAX
						tag = SLJ
						tag = BAN
						tag = SAJ
						tag = RSS
						tag = DRV
					}
				}
				add_ideas = RAJ_destroyed_country
			}
		}
		RAJ = {
			add_ideas = RAJ_indian_civil_war_idea
			clr_country_flag = JAP_PEC_member_flag
			drop_cosmetic_tag = yes
			clr_country_flag = eadi_member
			set_politics = {
				ruling_party = conservative
				elections_allowed = no 
			}
			add_popularity = {
				ideology = communist
				popularity = -0.3
			}
			add_popularity = {
				ideology = nationalist
				popularity = -0.3
			}
			remove_ideas = {
				JAP_PDTO_member_1
				JAP_PDTO_member_2
				JAP_PEC_member
				JAP_PEC_member_2
			}
			set_nationality = {
				target_country = RJN
				character = RAJ_Karambir_Singh
			}
			RJN = {
				add_country_leader_role = {
				    character = RAJ_Karambir_Singh
				    promote_leader = yes
				    country_leader = {
				        ideology = military_junta
				        expire = "1.1.1.1"
				        traits = {
						}
				    }
				}
			}
			set_nationality = {
				target_country = RSS
				character = RAJ_Mohan_Bhagwat
			}
			RSS = {
				promote_character = RAJ_Mohan_Bhagwat
			}
			set_nationality = {
				target_country = LRJ
				character = RAJ_Rahul_Ghandi
			}
			LRJ = {
				promote_character = RAJ_Rahul_Ghandi
			}
			set_nationality = {
				target_country = UPJ
				character = RAJ_Amardeep_Singh_Bhinder
			}
			UPJ = {
				add_country_leader_role = {
					character = RAJ_Amardeep_Singh_Bhinder
					promote_leader = yes
					country_leader = {
						ideology = military_junta
						traits = {
						}
					}
				}
			}
			set_nationality = {
				target_country = MPJ
				character = RAJ_Suchindra_Kumar
			}
			MPJ = {
				add_country_leader_role = {
					character = RAJ_Suchindra_Kumar
					promote_leader = yes
					country_leader = {
						ideology = military_democracy
						traits = {
						}
					}
				}
			}
			set_nationality = {
				target_country = SAJ
				character = RAJ_Anil_Chauhan
			}
			SAJ = {
				add_country_leader_role = {
					character = RAJ_Anil_Chauhan
					promote_leader = yes
					country_leader = {
						ideology = military_democracy
						traits = {
						}
					}
				}
			}
			set_nationality = {
				target_country = SLJ
				character = RAJ_Yogendra_Dimri
			}
			SLJ = {
				add_country_leader_role = {
					character = RAJ_Yogendra_Dimri
					promote_leader = yes
					country_leader = {
						ideology = military_democracy
						traits = {
						}
					}
				}
			}
			transfer_navy = {
				target = RJN
			}
			transfer_units_fraction = {
				target = MPJ
				size = 0.1
				stockpile_ratio = 0.05
				army_ratio = 0.1
				navy_ratio = 0.05
				air_ratio = 0.05
			}
			transfer_units_fraction = {
				target = UPJ
				size = 0.1
				stockpile_ratio = 0.05
				army_ratio = 0.1
				navy_ratio = 0.05
				air_ratio = 0.05
			}
			transfer_units_fraction = {
				target = NBG
				size = 0.1
				stockpile_ratio = 0.05
				army_ratio = 0.1
				navy_ratio = 0.05
				air_ratio = 0.05
			}
			transfer_units_fraction = {
				target = LRJ
				size = 0.3
				stockpile_ratio = 0.05
				army_ratio = 0.3
				navy_ratio = 0.05
				air_ratio = 0.05
			}
			transfer_units_fraction = {
				target = NAX
				size = 0.1
				stockpile_ratio = 0.05
				army_ratio = 0.1
				navy_ratio = 0.05
				air_ratio = 0.05
			}
			transfer_units_fraction = {
				target = RSS
				size = 0.1
				stockpile_ratio = 0.05
				army_ratio = 0.1
				navy_ratio = 0.05
				air_ratio = 0.05
			}
			transfer_units_fraction = {
				target = SAJ
				size = 0.25
				stockpile_ratio = 0.05
				army_ratio = 0.25
				navy_ratio = 0.05
				air_ratio = 0.05
			}
			give_military_access = PRC
			give_military_access = PAK
		}
		if = {
			limit = {
				430 = {
					controller = {
						OR = {
							tag = PRC
							is_ally_with = PRC
						}
					}
				}
				PRC = {
					has_completed_focus = PRC_operation_gangaridai
				}
			}
			PRJ = {
				annex_country = {
				    target = BAN
				    transfer_troops = no
				}
			}
		}
		if = {
			limit = {
				PRC = {
					controls_state = 424
					has_completed_focus = PRC_operation_pallava
				}
			}
			PRJ = {
				transfer_state = 424
			}
		}
		if = {
			limit = {
				PRC = {
					controls_state = 1418
					has_completed_focus = PRC_operation_pallava
				}
			}
			PRJ = {
				transfer_state = 1418
			}
		}
		if = {
			limit = {
				OR = {
					original_tag = UPJ
					original_tag = MPJ
					original_tag = SLJ
					original_tag = DRV #idk actually
					original_tag = SAJ
				}
			}
			add_ideas = RAJ_army_remnants_idea
		}
		set_global_flag = RAJ_india_dead
		RAJ = {
			mark_focus_tree_layout_dirty = yes
		}
	}

	PRC_gaw_start = {
		every_state = {
			limit = {
				OR = {
					state = 787
					state = 1132
					state = 440
					state = 1380
					state = 442
					state = 443
					state = 445
					state = 1324
					state = 441
					state = 1131
					state = 1373
					state = 439
					state = 1381
					state = 437
					state = 1397
					state = 1398
					state = 1370
					state = 789
					state = 432
					state = 1367
					state = 434
					state = 1366
					state = 1368
					state = 1369
					state = 430
					state = 431
					state = 424
					state = 1418
					state = 1413
					state = 1417
					state = 1414
					state = 1415
					state = 1416
					state = 422
					region = 146
					region = 189
					region = 142
					region = 188
					region = 160
					region = 159
					region = 187
					region = 158
					region = 93
					region = 167
					region = 193
					region = 194
					region = 195
					region = 156
					region = 76
					region = 154
					region = 165
					region = 164
					region = 143
					region = 145
					region = 220
					region = 216
					region = 219
					region = 152
					state = 428
					state = 433
					state = 1379
					state = 438
					state = 436
					state = 1400
					state = 1399
					state = 435
					state = 1371
					state = 426
					state = 1372
					state = 427
					state = 425
					state = 423
					state = 320
					state = 429
					state = 716
					state = 1394
					state = 328
					state = 717
				}
			}
			add_dynamic_modifier = {
				modifier = PRC_unplanned_offensive
				days = 575
			}
		}
		#every_state = {
		#	limit = {
		#		OR = {
		#		}
		#	}
		#	add_dynamic_modifier = {
		#		modifier = PRC_non_combat_area
		#	}
		#}
		if = {
			limit = {
				CAM = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = CAM }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = CAM }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = CAM }
					}
					50 = {
						JAP = { add_to_faction = CAM }
					}
				}
			}
		}
		if = {
			limit = {
				INS = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = INS }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = INS }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = INS }
					}
					50 = {
						JAP = { add_to_faction = INS }
					}
				}
			}
		}
		if = {
			limit = {
				LAO = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = LAO }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = LAO }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = LAO }
					}
					50 = {
						JAP = { add_to_faction = LAO }
					}
				}
			}
		}
		if = {
			limit = {
				MAL = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = MAL }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = MAL }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = MAL }
					}
					50 = {
						JAP = { add_to_faction = MAL }
					}
				}
			}
		}
		if = {
			limit = {
				BRM = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = BRM }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = BRM }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = BRM }
					}
					50 = {
						JAP = { add_to_faction = BRM }
					}
				}
			}
		}
		if = {
			limit = {
				PHI = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = PHI }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = PHI }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = PHI }
					}
					50 = {
						JAP = { add_to_faction = PHI }
					}
				}
			}
		}
		if = {
			limit = {
				SIG = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = SIG }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = SIG }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = SIG }
					}
					50 = {
						JAP = { add_to_faction = SIG }
					}
				}
			}
		}
		if = {
			limit = {
				SIA = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = SIA }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = SIA }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = SIA }
					}
					50 = {
						JAP = { add_to_faction = SIA }
					}
				}
			}
		}
		if = {
			limit = {
				VIN = {
					is_in_faction = no
				}
			}
			if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var > global.JAP_influence_CAM_var }
				}
				PRC = { add_to_faction = VIN }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var < global.JAP_influence_CAM_var }
				}
				JAP = { add_to_faction = VIN }
			}
			else_if = {
				limit = {
					check_variable = { global.PRC_influence_CAM_var = global.JAP_influence_CAM_var }
				}
				random_list = {
					50 = {
						PRC = { add_to_faction = VIN }
					}
					50 = {
						JAP = { add_to_faction = VIN }
					}
				}
			}
		}
		JAP = {
			country_event = {
				id = jap.1002
				hours = 6
			}
			activate_mission = JAP_GAW_war_exhaustion
			PRC_GAW_check_faction_members = yes
			add_dynamic_modifier = {
				modifier = PRC_war_exhaustion_dynamic
			}
			load_oob = GAW_reserves_jap1
		}
		if = {
			limit = {
				JAP = {
					is_ai = yes
				}
			}
			JAP = {
				load_oob = GAW_reserves_jap1_ai
			}
		}
		news_event = news.415
		set_global_flag = pan_asian_war_ongoing
		clr_global_flag = GAW_soon
		activate_mission = PRC_GAW_war_exhaustion
		PRC_GAW_check_faction_members = yes
		add_dynamic_modifier = {
			modifier = PRC_war_exhaustion_dynamic
		}
		AST = {
			country_event = {
				id = Australia_gaw.1
				hours = 6
			}
			activate_mission = JAP_GAW_war_exhaustion
			PRC_GAW_check_faction_members = yes
			add_dynamic_modifier = {
				modifier = PRC_war_exhaustion_dynamic
			}
			load_oob = GAW_reserves_ast1_ai
			if = {
				limit = { has_dlc = "Man the Guns" }
					load_oob = "AST_2000_naval_mtg"
					load_oob = "AST_2000_naval_mtg"
					load_oob = "AST_2000_naval_mtg"
				else = {
					load_oob = "AST_2000_naval_legacy"
					load_oob = "AST_2000_naval_legacy"
					load_oob = "AST_2000_naval_legacy"
				}
			}
		}
		RAJ = {
			country_event = {
				id = RAJ.19
				hours = 6
			}
			activate_mission = JAP_GAW_war_exhaustion
			PRC_GAW_check_faction_members = yes
			add_dynamic_modifier = {
				modifier = PRC_war_exhaustion_dynamic
			}
			load_oob = GAW_militia_raj1
			load_oob = GAW_templates_for_ai
			if = {
				limit = { has_dlc = "Man the Guns" }
					load_oob = "RAJ_2000_naval_mtg"
				else = {
					load_oob = "RAJ_2000_naval_legacy"
				}
			}
		}
		CHI = {
			country_event = {
				id = taiwan.500
				hours = 6
			}
			activate_mission = JAP_GAW_war_exhaustion
			PRC_GAW_check_faction_members = yes
			add_dynamic_modifier = {
				modifier = PRC_war_exhaustion_dynamic
			}
		}
		CUB = {
			activate_mission = great_asian_war_mission
		}
		if = {
			limit = {
				PRC = {
					is_ai = yes
				}
			}
			PAK = {
				load_oob = GAW_militia_pak1
			}
		}
		if = {
			limit = {
				JAP  = {
					is_ai = yes
				}
				PRC  = {
					is_ai = no
				}
			}
			every_country = {
				limit = {
					OR = {
						tag = AST
						tag = RAJ
						tag = JAP
					}
				}
				add_ideas = JAP_AST_RAJ_ai_buff_against_prc_player_gaw
			}
		}
		if = {
			limit = {
				JAP  = {
					is_ai = no
				}
				PRC  = {
					is_ai = yes
				}
			}
			PRC =  {
				add_ideas = PRC_ai_buff_against_jap_player_gaw
			}
		}
		every_country = {
			limit = {
				OR = {
					tag = NEP
					tag = SRL
					tag = VIN
					tag = LAO
					tag = CAM
					tag = SIA
					tag = MAL
					tag = SIG
					tag = INS
					tag = PHI
					tag = PNG
					tag = NZL
					tag = BAN
				}
			}
			load_oob = GAW_templates_for_ai
			capital_scope = {
				create_unit = {
					division = "division_template = \"GAW Militia\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
					owner = PREV
					count = 6
				}
				create_unit = {
					division = "division_template = \"GAW Regular Infantry\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
					owner = PREV
					count = 4
				}
			}
		}
		if = {
			limit = {
				PRC = {
					has_completed_focus = PRC_towards_a_digital_world
					is_ironman = yes
					has_any_custom_difficulty_setting = no
					game_rules_allow_achievements = yes
					has_start_date < 2020.01.02
					difficulty > 3
					is_debug = no
					is_ai = no
					NOT = {
						OR = {
							is_in_faction_with = VIN
							is_in_faction_with = BHU
							is_in_faction_with = NEP
							is_in_faction_with = LAO
							is_in_faction_with = CAM
							is_in_faction_with = SIA
							is_in_faction_with = BRM
							is_in_faction_with = MAL
							is_in_faction_with = SIG
							is_in_faction_with = INS
							is_in_faction_with = SRL
							is_in_faction_with = PAK
						}
					}
				}
			}
			set_global_flag = PRC_big_sister_victory_conditions_fulfilled
		}
		if = {
			limit = {
				PRC = {
					has_country_flag = PRC_nationalist_win
				}
			}
			if = {
				limit = {
					PRC = {
						is_ai = yes
					}
				}
				every_country = {
					limit = {
						is_ally_with = JAP
					}
					add_ideas = PDTO_our_final_war_idea
				}
			}
			else_if = {
				limit = {
					PRC = {
						is_ai = no
					}
					JAP = {
						is_ai = no
					}
				}
				every_country = {
					limit = {
						is_ally_with = JAP
					}
					add_ideas = PDTO_our_final_war_idea
				}
			}
			else_if = {
				limit = {
					PRC = {
						is_ai = no
					}
					JAP = {
						is_ai = yes
					}
				}
				every_country = {
					limit = {
						is_ally_with = JAP
					}
					add_ideas = PDTO_our_final_war_idea_ai
				}
			}
			every_country = {
				limit = {
					is_ally_with = JAP
				}
				add_offsite_building = { type = arms_factory level = 5 }
				add_manpower = 100000
				capital_scope = {
					create_unit = {
						division = "division_template = \"GAW Militia\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
						owner = PREV
						count = 8
					}
					create_unit = {
						division = "division_template = \"GAW Regular Infantry\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
						owner = PREV
						count = 6
					}
				}
			}
		}
	}
	
PRC_remove_special_regional_modifiers = {
	custom_effect_tooltip = SOV_remove_special_regional_modifiers_tt
	hidden_effect = {
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_ningxia_hui_autonomous_region
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_ningxia_hui_autonomous_region
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_tibet_autonomous_region
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_tibet_autonomous_region
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_xinjiang_uygur_autonomous_region
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_xinjiang_uygur_autonomous_region
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_inner_mongolia_autonomous_region
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_inner_mongolia_autonomous_region
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_guangxi_zhuang_autonomous_region
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_guangxi_zhuang_autonomous_region
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_ningxia_hui_autonomous_region_yanshun
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_ningxia_hui_autonomous_region_yanshun
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_tibet_autonomous_region_junzheng
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_tibet_autonomous_region_junzheng
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_xinjiang_uygur_autonomous_region_xingrui
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_xinjiang_uygur_autonomous_region_xingrui
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_inner_mongolia_autonomous_region_shaocheng
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_inner_mongolia_autonomous_region_shaocheng
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_guangxi_zhuang_autonomous_region_ning
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_guangxi_zhuang_autonomous_region_ning
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_taiwan_autonomous_region
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_taiwan_autonomous_region
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_macau
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_macau
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_hong_kong
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_hong_kong
			}
		}
		every_owned_state = {
			limit = {
				has_dynamic_modifier = {
					modifier = PRC_hong_kong_lee
				}
			}
			remove_dynamic_modifier = {
				modifier = PRC_hong_kong_lee
			}
		}
	}
	force_update_dynamic_modifier = yes
}

PRC_GAW_check_faction_members = {
	hidden_effect = {
		if = {
			limit = {
				is_ally_with = VIN
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = LAO
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = CAM
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = SIA
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = BRM
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = MAL
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = SIG
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = INS
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
		if = {
			limit = {
				is_ally_with = PHI
			}
			add_days_mission_timeout = {
				mission = PRC_GAW_war_exhaustion
				days = 20
			}
		}
	}
}

PRC_join_BRI = {
	set_country_flag = PRC_BRI_member_flag
	add_ideas = {
		PRC_BRI_member
	}
	PRC = {
		add_to_variable = {
			PRC_BRI_number_of_members = 1
		}
		add_to_variable = {
			PRC_BRI_consumer_goods_factor = -0.001
		}
		add_to_variable = {
			PRC_BRI_income_growth_factor = 0.001
		}
		add_to_variable = {
			PRC_BRI_lend_lease_tension = -0.01
		}
		add_to_variable = {
			PRC_BRI_poverty_development_monthly = 0.001
		}
		add_to_variable = {
			PRC_BRI_industrial_development_monthly = 0.001
		}
		add_to_variable = {
			PRC_BRI_global_building_slots_factor = 0.005
		}
		add_to_variable = {
			PRC_BRI_production_speed_buildings_factor = 0.005
		}
	}
	add_to_array = {
		PRC.PRC_BRI_members = THIS
	}
	add_opinion_modifier = {
		target = PRC
		modifier = friendship_of_peoples
	}
	PRC = {
		add_opinion_modifier = {
			target = ROOT
			modifier = friendship_of_peoples
		}
	}
}
PRC_leave_BRI = {
	remove_ideas = {
		PRC_BRI_member
	}
	PRC = {
		add_to_variable = {
			PRC_BRI_number_of_members = -1
		}
		add_to_variable = {
			PRC_BRI_consumer_goods_factor = 0.001
		}
		add_to_variable = {
			PRC_BRI_income_growth_factor = -0.001
		}
		add_to_variable = {
			PRC_BRI_lend_lease_tension = 0.01
		}
		add_to_variable = {
			PRC_BRI_poverty_development_monthly = -0.001
		}
		add_to_variable = {
			PRC_BRI_industrial_development_monthly = -0.001
		}
		add_to_variable = {
			PRC_BRI_global_building_slots_factor = -0.005
		}
		add_to_variable = {
			PRC_BRI_production_speed_buildings_factor = -0.005
		}
	}
	remove_from_array = {
		PRC.PRC_BRI_members = THIS
	}
}

PRC_cw_warlords_setup = {
	new_country = yes
	inherit_technology = PRC
	if = {
		limit = {
			has_dlc = "No Step Back"
		}
		create_equipment_variant = {
			name = "ZTD-05"
			type = amphibious_tank_chassis_1
			parent_version = 0
			modules = {
				main_armament_slot = tank_small_cannon
				turret_type_slot = tank_light_two_man_tank_turret
				suspension_type_slot = tank_christie_suspension
				armor_type_slot = tank_riveted_armor
				engine_type_slot = tank_gasoline_engine
				special_type_slot_1 = tank_radio_1
				special_type_slot_2 = smoke_launchers
				special_type_slot_3 = empty
				special_type_slot_4 = empty
			}
			upgrades = {
				tank_nsb_engine_upgrade = 2
				tank_nsb_armor_upgrade = 3
			}
			icon = "gfx/interface/technologies/armor/PRC_light_tank1.png"
		}
		create_equipment_variant = {
			name = "ZTZ-96B"
			type = modern_tank_chassis_1
			parent_version = 0
			modules = {
				main_armament_slot = tank_high_velocity_cannon_2
				turret_type_slot = tank_modern_tank_turret
				suspension_type_slot = tank_torsion_bar_suspension
				armor_type_slot = tank_riveted_armor
				engine_type_slot = tank_diesel_engine
				special_type_slot_1 = tank_radio_1
				special_type_slot_2 = smoke_launchers
				special_type_slot_3 = auto_loader
				special_type_slot_4 = sloped_armor
			}
			upgrades = {
				tank_nsb_engine_upgrade = 9
				tank_nsb_armor_upgrade = 4
			}
			icon = "gfx/interface/technologies/armor/PRC_modern_tank6.dds"
		}
		create_equipment_variant = {
			name = "ZTZ-99A"
			type = modern_tank_chassis_2
			parent_version = 0
			modules = {
				main_armament_slot = tank_high_velocity_cannon_2
				turret_type_slot = tank_modern_tank_turret
				suspension_type_slot = tank_torsion_bar_suspension
				armor_type_slot = tank_cast_armor
				engine_type_slot = tank_gas_turbine_engine
				special_type_slot_1 = tank_radio_1
				special_type_slot_2 = auto_loader
				special_type_slot_3 = empty
				special_type_slot_4 = empty
			}
			upgrades = {
				tank_nsb_engine_upgrade = 8
				tank_nsb_armor_upgrade = 1
			}
			icon = "gfx/interface/technologies/armor/PRC_modern_tank7.png"
		}
		create_equipment_variant = {
			name = "ZTQ-15"
			type = light_tank_chassis_1
			parent_version = 0
			modules = {
				main_armament_slot = tank_small_cannon
				turret_type_slot = tank_light_two_man_tank_turret
				suspension_type_slot = tank_christie_suspension
				armor_type_slot = tank_riveted_armor
				engine_type_slot = tank_gasoline_engine
				special_type_slot_1 = tank_radio_1
				special_type_slot_2 = extra_ammo_storage
				special_type_slot_3 = smoke_launchers
				special_type_slot_4 = empty
			}
			upgrades = {
				tank_nsb_engine_upgrade = 3
				tank_nsb_armor_upgrade = 2
			}
			icon = "gfx/interface/technologies/armor/PRC_light_tank3.dds"
		}
	}
}

PRC_change_anti_technocratic_movement_rate = {
	#custom_effect_tooltip = 
	add_to_variable = {
		var = PRC_anti_technocratic_movement_rate
		value = PRC_anti_technocratic_movement_rate_temp
	}
	clamp_variable = {
		var = PRC_anti_technocratic_movement_rate
		min = 0
		max = 1
	}
	set_temp_variable = {
		var = PRC_anti_technocratic_movement_rate_temp
		value = PRC_anti_technocratic_movement_rate
	}
	add_to_temp_variable = {
		var = PRC_anti_technocratic_movement_rate_temp
		value = -0.25
	}
	set_variable = {
		var = PRC_anti_technocratic_movement_stability_factor_dynamic_var
		value = PRC_anti_technocratic_movement_rate_temp
	}
	multiply_variable = {
		var = PRC_anti_technocratic_movement_stability_factor_dynamic_var
		value = -0.75
	}
	clamp_variable = {
		var = PRC_anti_technocratic_movement_stability_factor_dynamic_var
		min = -1
		max = 0
	}
}

PRC_create_new_hideout = {
	#custom_effect_tooltip = 
	if = {
		limit = {
			NOT = {has_country_flag = PRC_dont_create_hideout_this_time}
		}
		random_owned_state = {
			set_state_flag = PRC_hideout_of_the_movent
		}
		add_to_variable = {
		    var = PRC_anti_technocratic_movement_amount_of_hideouts
		    value = 1
		}
	}
	clr_country_flag = PRC_dont_create_hideout_this_time
}

PRC_change_MSS_support_rate = {
	#custom_effect_tooltip = 
	add_to_variable = {
		var = PRC_display_MSS_support_rate
		value = PRC_display_MSS_support_rate_temp
	}
	clamp_variable = {
		var = PRC_display_MSS_support_rate
		min = 0
		max = 1
	}
	set_temp_variable = {
		var = PRC_display_MSS_support_rate_temp
		value = PRC_display_MSS_support_rate
	}
	add_to_temp_variable = {
		var = PRC_display_MSS_support_rate_temp
		value = -0.5
	}
	set_variable = {
		var = PRC_opinion_of_MSS_faction_political_power_gain
		value = PRC_display_MSS_support_rate_temp
	}
	set_variable = {
		var = PRC_opinion_of_MSS_faction_military_development_monthly
		value = PRC_display_MSS_support_rate_temp
	}
	set_variable = {
		var = PRC_opinion_of_MSS_faction_power_balance_weekly
		value = PRC_display_MSS_support_rate_temp
	}
	multiply_variable = {
		var = PRC_opinion_of_MSS_faction_military_development_monthly
		value = 0.05
	}
	multiply_variable = {
		var = PRC_opinion_of_MSS_faction_political_power_gain
		value = 0.35
	}
	multiply_variable = {
		var = PRC_opinion_of_MSS_faction_power_balance_weekly
		value = -0.035
	}
	clamp_variable = {
		var = PRC_opinion_of_MSS_faction_power_balance_weekly
		min = -1
		max = 0
	}
}

PRC_change_scientists_support_rate = {
	#custom_effect_tooltip = 
	add_to_variable = {
		var = PRC_display_scientists_faction_support_rate
		value = PRC_display_scientists_faction_support_rate_temp
	}
	clamp_variable = {
		var = PRC_display_scientists_faction_support_rate
		min = 0
		max = 1
	}
	set_temp_variable = {
		var = PRC_display_scientists_faction_support_rate_temp
		value = PRC_display_scientists_faction_support_rate
	}
	add_to_temp_variable = {
		var = PRC_display_scientists_faction_support_rate_temp
		value = -0.5
	}
	set_variable = {
		var = PRC_opinion_of_scientists_faction_political_power_gain
		value = PRC_display_scientists_faction_support_rate_temp
	}
	set_variable = {
		var = PRC_opinion_of_scientists_faction_academic_development_monthly
		value = PRC_display_scientists_faction_support_rate_temp
	}
	set_variable = {
		var = PRC_opinion_of_scientists_faction_power_balance_weekly
		value = PRC_display_scientists_faction_support_rate_temp
	}
	multiply_variable = {
		var = PRC_opinion_of_scientists_faction_academic_development_monthly
		value = 0.05
	}
	multiply_variable = {
		var = PRC_opinion_of_scientists_faction_political_power_gain
		value = 0.25
	}
	multiply_variable = {
		var = PRC_opinion_of_scientists_faction_power_balance_weekly
		value = 0.035
	}
	clamp_variable = {
		var = PRC_opinion_of_scientists_faction_power_balance_weekly
		min = 0
		max = 1
	}
}

TFR_PRC_clear_econ_law_effect = {
	hidden_effect = {
		remove_ideas = common_prosperity_law_right_1
		remove_ideas = common_prosperity_law_right_2
		remove_ideas = common_prosperity_law_right_3
		remove_ideas = common_prosperity_law_right_4
		remove_ideas = common_prosperity_law
		remove_ideas = common_prosperity_law_left_1
		remove_ideas = common_prosperity_law_left_2
		remove_ideas = common_prosperity_law_left_3
		remove_ideas = common_prosperity_law_left_4
	}
}