### #  # ### ### #  ### ###   ##  ### ###  ##  #  #
 #  ## # #    #  #   #  #  # #  #  #   #  #  # ## #
 #  # ## ##   #  #   #  ###  ####  #   #  #  # # ##
 #  #  # #    #  #   #  #  # #  #  #   #  #  # #  #
### #  # #   ### ### #  #  # #  #  #  ###  ##  #  #

#Category only allowed for is_potentially_communist_china
#Category visible when PRC_infiltration focus is completed

#INFILTRATE_STATE_AI_WILL_DO <ID>
#INFILTRATE_JAP_STATE_AI_WILL_DO <ID>


@INFILTRATION_INF_EQ_COST = -500
@DAYS_REMOVE_INFILTRATE_STATE = 30

PRC_infiltrate_nationalist_areas = { 

# 283
# 597
# 598
# 607
# 608
# 614
# 615
# 621
# 744
# 746

	PRC_uprising = {
		icon = generic_ignite_civil_war
	
		visible = {
			has_government = communism
			OR = { 
				NOT = { has_war_with = JAP }
				is_ai = no
			}
		}
		
		available = {
			OR = {
				AND = {
					PRC_uprising_is_available = yes
					date > 1945.1.1
					AND = {
						OR = {
							has_global_flag = {
								flag =  released_PRC
								days > 365
							}
							NOT = { has_global_flag = released_PRC }
						}
						OR = {
							NOT = { has_global_flag = kwantung_intervention }
							has_global_flag = {
								flag =  kwantung_intervention
								days > 120
							}
						}
					}
				}
			}
		}

		fire_only_once = yes

		days_remove = 60

		war_with_on_remove = CHI

		cost = 25

		ai_will_do = {
			base = 0

			modifier = {
				#Block if still trying to kill JAP
				factor = 0
				AND = {
					has_war_with = JAP
					#Allow JAP, faction member or puppet to control 5 states at most before triggering civil war
					count_triggers = {
						amount = 5
						612 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						621 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						615 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						609 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						611 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						610 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						715 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						328 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						527 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						525 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						717 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						714 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						595 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						596 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						597 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						598 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						600 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						601 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						602 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						603 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						605 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						606 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						607 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						608 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						613 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						614 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						620 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						744 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
						746 = { CONTROLLER = { is_JAP_or_ally_of_JAP = yes } }
					}
				}
			}

			#The more troops, the bigger chance
			modifier = {
				add = 10
				283 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				597 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				598 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				607 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				608 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				614 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				615 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				621 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				744 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}
			modifier = {
				add = 10
				746 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
			}

			#Sabotage is also nice
			modifier = {
				add = 3
				283 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				597 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				598 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				607 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				608 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				614 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				615 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				621 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				744 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				746 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}

			modifier = {
				add = 9999
				AND = {
					NOT = { has_war_with = JAP }
					date > 1945.1.1
				}
			}
		}

		complete_effect = {
			hidden_effect = {
				event_target:WTT_current_china_leader = { country_event = wtt_infiltration.10 }
			}
		}
	
		remove_effect = {
			if = {
				limit = {
					is_in_faction_with = event_target:WTT_current_china_leader
				}
				faction_leader = { remove_from_faction = ROOT }
			}
			declare_war_on = { target = event_target:WTT_current_china_leader type = annex_everything }
			283 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			597 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			598 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			607 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			608 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			614 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			615 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			621 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			744 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			746 = {
				if = {
					limit = {
						CONTROLLER = { tag = event_target:WTT_current_china_leader }
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
		}
	}
	
	PRC_infiltrate_gansu = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			283 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {			
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			283 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 283
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 283
		ai_will_do = {
			base = 120
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						283 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				283 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				283 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			283 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			283 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_shandong = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			597 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			597 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 597
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 597
		ai_will_do = {
			base = 80
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						597 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				597 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				597 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			597 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			597 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_jiangsu = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			598 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			598 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 598
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 598
		ai_will_do = {
			base = 80
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						598 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				598 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				598 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			598 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			598 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_henan = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			607 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			607 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 607
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 607
		ai_will_do = {
			base = 100
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						607 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				607 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				607 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}
			607 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			607 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_beijing = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			608 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			608 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 608
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 608
		ai_will_do = {
			base = 80
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						608 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				608 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				608 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			608 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			608 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_hebei = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			614 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			614 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 614
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 614
		ai_will_do = {
			base = 80
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						614 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				614 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				614 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			614 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			614 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_shanxi = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			615 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			615 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 615
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 615
		ai_will_do = {
			base = 120
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						615 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				615 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				615 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			615 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			615 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_suiyuan = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			621 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			621 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 621
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 621
		ai_will_do = {
			base = 80
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						621 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				621 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				621 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			621 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			621 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_xian = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			744 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			744 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 744
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 744
		ai_will_do = {
			base = 120
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						744 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				744 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				744 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			744 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			744 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_ordos = {
		
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_infiltration
			746 = {
				CONTROLLER = {
					tag = event_target:WTT_current_china_leader
				}
			}
		}
		
		available = {
			NOT = { has_war_with = event_target:WTT_current_china_leader }
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			746 = {
				PRC_can_increase_infiltration_in_state = yes
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 746
		} 
}
		
		modifier = {
			command_power_gain = -0.2
		}
		
		#INFILTRATE_STATE_AI_WILL_DO 746
		ai_will_do = {
			base = 120
			modifier = {
				factor = 0
				has_decision = PRC_uprising # don't throw away rifles if the uprising is going to start before you can finish this
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						746 = { has_state_flag = discovered_infiltration }
						PRC_all_nationalist_area_infiltration_discovered = no
					}
				}
			}
			modifier = {
				factor = 25
				746 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value > 0
					}
				}
			}
			modifier = {
				factor = 50 #Really want to get to troop level
				746 = {
					has_state_flag = {
						flag = PRC_infiltration_@PREV
						value = 2
					}
				}
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0
	
		cost = 10
	
		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			746 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			746 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}

}



 ##  #  # ### ###   ####  ##  ##   ##  #  #
#  # ## #  #   #       # #  # # # #  # ## #
#### # ##  #   #    #  # #### ##  #### # ##
#  # #  #  #   #    #  # #  # #   #  # #  #
#  # #  #  #  ###    ##  #  # #   #  # #  #

#Category only allowed for is_potentially_communist_china
#Category visible when PRC_infiltration focus is completed
PRC_anti_japanese_expedition = {
	#609 #"east_hebei"
	#610 #"jehol"
	#611 #"south_chahar"
	#612 #"chahar"
	#714 #"heilungkiang"
	#715 #"liaoning"

	PRC_anti_japanese_uprising = {
		icon = revolt
		visible = {
			has_government = communism
		}
		
		available = {
			custom_trigger_tooltip = {
				tooltip = PRC_uprising_is_available
				any_state = {
					CONTROLLER = {
						OR = {
							original_tag = MAN
							original_tag = MEN
							original_tag = JAP
						}
					}
					PRC_is_infiltrated_by_PREV = yes
				}
			}
		}

		fire_only_once = yes

		days_remove = 30

		modifier = {
			political_power_gain = -0.5
		}

		cost = 10
		
		ai_will_do = {
			base = 0

			modifier = {
				add = 100
				PRC_ROOT_war_with_controller_of_anti_japan_infiltrated_state = yes				
			}

			#Block if not at least 2 troops and states are instant flipped
			modifier = {
				factor = 0
				NOT = { has_war_with = JAP }
				NOT = { has_war_with = MEN }
				NOT = { has_war_with = MAN }
				NOT = {
					count_triggers = {
						amount = 2
						609 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
						610 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
						611 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
						612 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
						714 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
						715 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					}
				}
			}

			#The more troops, the more attractive the option to trigger
			modifier = {
				factor = 25
				count_triggers = {
					amount = 2
					609 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					610 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					611 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					612 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					714 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					715 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
				}
			}
			modifier = {
				factor = 25
				count_triggers = {
					amount = 3
					609 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					610 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					611 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					612 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					714 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					715 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
				}
			}
			modifier = {
				factor = 50
				count_triggers = {
					amount = 4
					609 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					610 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					611 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					612 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					714 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
					715 = { PRC_infiltration_uprising_PREV_will_spawn_troops_in_state = yes }
				}
			}

			#Sabotage is also nice
			modifier = {
				add = 3
				609 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				610 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				611 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				612 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				714 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
			modifier = {
				add = 3
				715 = { PRC_infiltration_uprising_PREV_will_sabotage_state = yes }
			}
		}


		complete_effect = {
			hidden_effect = {
				MAN = { country_event = wtt_infiltration.10 }
				MEN = { country_event = wtt_infiltration.10 }
				JAP = { country_event = wtt_infiltration.10 }
			}
		}

		war_with_on_remove = JAP
		war_with_on_remove = MEN
		war_with_on_remove = MAN
	
		remove_effect = {
			declare_war_on = { target = JAP type = annex_everything }
			if = {
				limit = {
					MAN = { 
						exists = yes
					}
				}
				declare_war_on = { target = MAN type = annex_everything }
			}
			if = {
				limit = {
					MEN = { 
						exists = yes
					}
				}
				declare_war_on = { target = MEN type = annex_everything }
			}

			609 = { #east_hebei
				if = {
					limit = {
						CONTROLLER = {
							OR = {
								original_tag = MAN
								original_tag = MEN
								original_tag = JAP
							}
						}
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}

			 
			610 = { #jehol
				if = {
					limit = {
						CONTROLLER = {
							OR = {
								original_tag = MAN
								original_tag = MEN
								original_tag = JAP
							}
						}
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			 
			611 = { #south_chahar
				if = {
					limit = {
						CONTROLLER = {
							OR = {
								original_tag = MAN
								original_tag = MEN
								original_tag = JAP
							}
						}
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			 
			612 = { #chahar
				if = {
					limit = {
						CONTROLLER = {
							OR = {
								original_tag = MAN
								original_tag = MEN
								original_tag = JAP
							}
						}
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			 
			714 = { #heilungkiang
				if = {
					limit = {
						CONTROLLER = {
							OR = {
								original_tag = MAN
								original_tag = MEN
								original_tag = JAP
							}
						}
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
			 
			715 = { #liaoning
				if = {
					limit = {
						CONTROLLER = {
							OR = {
								original_tag = MAN
								original_tag = MEN
								original_tag = JAP
							}
						}
						PRC_is_infiltrated_by_PREV = yes
					}
					PRC_execute_infiltration_effects_for_PREV = yes
				}
			}
		}
	}
	
	PRC_infiltrate_east_hebei = { #609 #"east_hebei"
		icon = infiltrate_state
		visible = {	
			has_government = communism
			has_completed_focus = PRC_anti_japanese_expedition
			609 = {
				CONTROLLER = {
					NOT = { has_war_with = ROOT }
					OR = {
						original_tag = MAN
						original_tag = MEN
						original_tag = JAP
					}
				}
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 609
		} 
}
		
		available = {
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			609 = {
				PRC_can_increase_infiltration_in_state = yes
			}
			NOT = { has_war_with = JAP }
			NOT = { has_war_with = MEN }
			NOT = { has_war_with = MAN }
		}
		
		modifier = {
			command_power_gain = -0.2
		}
	
	#INFILTRATE_JAP_STATE_AI_WILL_DO 609
		ai_will_do = {
			base = 50

			modifier = {
				factor = 0
				609 = { has_state_flag = discovered_infiltration }
				PRC_all_anti_japan_infiltration_discovered = no
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0

		cost = 25

		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			609 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			609 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_jehol = { #610 #"jehol"
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_anti_japanese_expedition
			610 = {
				CONTROLLER = {
					NOT = { has_war_with = ROOT }
					OR = {
						original_tag = MAN
						original_tag = MEN
						original_tag = JAP
					}
				}
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 610
		} 
}
		
		available = {
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			610 = {
				PRC_can_increase_infiltration_in_state = yes
			}
			NOT = { has_war_with = JAP }
			NOT = { has_war_with = MEN }
			NOT = { has_war_with = MAN }
		}
		
		modifier = {
			command_power_gain = -0.2
		}
	
	#INFILTRATE_JAP_STATE_AI_WILL_DO 610
		ai_will_do = {
			base = 50

			modifier = {
				factor = 0
				610 = { has_state_flag = discovered_infiltration }
				PRC_all_anti_japan_infiltration_discovered = no
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0

		cost = 25

		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}
			610 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			610 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_south_chahar = { #611 #"south_chahar"
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_anti_japanese_expedition
			611 = {
				CONTROLLER = {
					NOT = { has_war_with = ROOT }
					OR = {
						original_tag = MAN
						original_tag = MEN
						original_tag = JAP
					}
				}
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 611
		} 
}
		
		available = {
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			611 = {
				PRC_can_increase_infiltration_in_state = yes
			}
			NOT = { has_war_with = JAP }
			NOT = { has_war_with = MEN }
			NOT = { has_war_with = MAN }
		}
		
		modifier = {
			command_power_gain = -0.2
		}
	
	#INFILTRATE_JAP_STATE_AI_WILL_DO 611
		ai_will_do = {
			base = 50

			modifier = {
				factor = 0
				611 = { has_state_flag = discovered_infiltration }
				PRC_all_anti_japan_infiltration_discovered = no
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0

		cost = 25

		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			611 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			611 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_chahar = { #612 #"chahar"
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_anti_japanese_expedition
			612 = {
				CONTROLLER = {
					NOT = { has_war_with = ROOT }
					OR = {
						original_tag = MAN
						original_tag = MEN
						original_tag = JAP
					}
				}
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 612
		} 
}
		
		available = {
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			612 = {
				PRC_can_increase_infiltration_in_state = yes
			}
			NOT = { has_war_with = JAP }
			NOT = { has_war_with = MEN }
			NOT = { has_war_with = MAN }
		}
		
		modifier = {
			command_power_gain = -0.2
		}
	
	#INFILTRATE_JAP_STATE_AI_WILL_DO 612
		ai_will_do = {
			base = 50

			modifier = {
				factor = 0
				612 = { has_state_flag = discovered_infiltration }
				PRC_all_anti_japan_infiltration_discovered = no
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0

		cost = 25

		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			612 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			612 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_heilungkiang = { #714 #"heilungkiang"
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_anti_japanese_expedition
			714 = {
				CONTROLLER = {
					NOT = { has_war_with = ROOT }
					OR = {
						original_tag = MAN
						original_tag = MEN
						original_tag = JAP
					}
				}
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 714
		} 
}
		
		available = {
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			714 = {
				PRC_can_increase_infiltration_in_state = yes
			}
			NOT = { has_war_with = JAP }
			NOT = { has_war_with = MEN }
			NOT = { has_war_with = MAN }
		}
		
		modifier = {
			command_power_gain = -0.2
		}
	
	#INFILTRATE_JAP_STATE_AI_WILL_DO 714
		ai_will_do = {
			base = 50

			modifier = {
				factor = 0
				714 = { has_state_flag = discovered_infiltration }
				PRC_all_anti_japan_infiltration_discovered = no
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0

		cost = 25

		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			714 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			714 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
	
	PRC_infiltrate_liaoning = { #715 #"liaoning"
		icon = infiltrate_state
		visible = {
			has_government = communism
			has_completed_focus = PRC_anti_japanese_expedition
			715 = {
				CONTROLLER = {
					NOT = { has_war_with = ROOT }
					OR = {
						original_tag = MAN
						original_tag = MEN
						original_tag = JAP
					}
				}
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 715
		} 
}
		
		available = {
			PRC_is_not_infiltrating_a_state = yes
			has_equipment = { infantry_equipment > 499 }
			715 = {
				PRC_can_increase_infiltration_in_state = yes
			}
			NOT = { has_war_with = JAP }
			NOT = { has_war_with = MEN }
			NOT = { has_war_with = MAN }
		}
		
		modifier = {
			command_power_gain = -0.2
		}
	
	#INFILTRATE_JAP_STATE_AI_WILL_DO 715
		ai_will_do = {
			base = 50

			modifier = {
				factor = 0
				715 = { has_state_flag = discovered_infiltration }
				PRC_all_anti_japan_infiltration_discovered = no
			}
		}

		days_remove = @DAYS_REMOVE_INFILTRATE_STATE
		days_re_enable = 0

		cost = 25

		complete_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @INFILTRATION_INF_EQ_COST
			}			
			715 = {
				if = {
					limit = {
						NOT = { has_state_flag = PRC_infiltration_@ROOT }
					}
					set_state_flag = {
						flag = PRC_infiltration_@ROOT
						value = 0
					}
				}
			}
		}

		remove_effect = {
			715 = {
				PRC_infiltration_succesful_show_uprising_effect = yes
				modify_state_flag = {
					flag = PRC_infiltration_@ROOT
					value = 1
				}
			}
		}
	}
}
operations = {
	PRC_launch_100_regiments_campaign = {
		icon = generic_prepare_civil_war
		visible = {
			has_completed_focus = PRC_100_regiments_campaign
		}
		cost = 0
		fire_only_once = yes
		ai_will_do = {
			factor = 1
		}
		days_remove = 180

		modifier = {
			army_core_attack_factor = 0.25
		}
	}	
}

PRC_provoke_japan = {

	PRC_provoke_japan = {

		icon = generic_ignite_civil_war
		available = {
			not = {
				has_war_with = JAP
			}
			OR = {
				is_subject = no
				is_subject_of = event_target:WTT_current_china_leader
			}
			OR = {
				MAN = { 
					OR = {
						is_subject_of = JAP
						has_cosmetic_tag = MAN_kwantung_army 
					}
				}
				JAP = {
					owns_state = 525
					owns_state = 527
				}
			}
		}
		visible = {
			not = {
				has_war_with = JAP
			}
			OR = {
				MAN = { 
					OR = {
						is_subject_of = JAP 
						has_cosmetic_tag = MAN_kwantung_army 
					}
				}
				JAP = {
					owns_state = 525
					owns_state = 527
				}
			}
		}
		cost = 10
		ai_will_do = {
			factor = 1
			modifier = {
				has_war_with = event_target:WTT_current_china_leader
				factor = 0 # let's just not make things worse for ourselves
			}
			modifier = {
				JAP = {
					has_war_with = event_target:WTT_current_china_leader
				}
				factor = 0 # mission accomplished
			}
		}
		fixed_random_seed = no
		days_re_enable = 90
		complete_effect = {
			IF = {
				limit = {
					OR = {
						MAN = {
							is_subject_of = JAP
						}
						JAP = {
							owns_state = 525
							owns_state = 527
						}
					}
				}
				JAP = {
					random_list = {
						25 = { country_event = wtt_prc.21 }# sabotage - military
						25 = { country_event = wtt_prc.22 }# sabotage - civilian
						25 = { country_event = wtt_prc.23 }# sabotage - infrastructure
						25 = { country_event = wtt_prc.24 }# patrol ambushed
					}
				}
			}
			else_if = {
				limit = {
					MAN = {
						has_cosmetic_tag = MAN_kwantung_army 
					}
				}
				MAN = {
					random_list = {
						25 = { country_event = wtt_prc.21 }# sabotage - military
						25 = { country_event = wtt_prc.22 }# sabotage - civilian
						25 = { country_event = wtt_prc.23 }# sabotage - infrastructure
						25 = { country_event = wtt_prc.24 }# patrol ambushed
					}
				}
			}
		}
	}
}

political_actions = {
	PRC_return_manchuria_communist = {

		available = {
			event_target:WTT_communist_china = {
				tag = ROOT
			}
			JAP = {
				has_government = communism
				not = {
					has_war_with = ROOT
				}
				is_in_faction_with = ROOT
				OR = {
					controls_state = 610
					controls_state = 716
					controls_state = 745
					controls_state = 328
					controls_state = 717
					controls_state = 714
					controls_state = 715
					controls_state = 761
					controls_state = 611
					controls_state = 612
					controls_state = 609
				}
			}
			MAN = {
				OR = {
					exists = no
					has_capitulated = yes
				}
			}
		}

		visible = {
			event_target:WTT_communist_china = {
				tag = ROOT
			}
			JAP = {
				has_government = communism
				not = {
					has_war_with = ROOT
				}
				is_in_faction_with = ROOT
				OR = {
					controls_state = 610
					controls_state = 716
					controls_state = 745
					controls_state = 328
					controls_state = 717
					controls_state = 714
					controls_state = 715
					controls_state = 761
					controls_state = 611
					controls_state = 612
					controls_state = 609
				}
			}
		}

		cost = 25

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			JAP = {
				country_event = wtt_japan.40
			}
		}

		remove_effect = {

		}
	}
	refuse_the_tribute = {

		icon = generic_political_actions

		allowed = {
			is_potentially_communist_china = yes
		}

		available = {
			
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = -50
						
				#Has somewhat won against CHI and JAP
				NOT = {
					count_triggers = {
						amount = 7
						595 = { is_controlled_by = ROOT }
						596 = { is_controlled_by = ROOT }
						597 = { is_controlled_by = ROOT }
						598 = { is_controlled_by = ROOT }
						600 = { is_controlled_by = ROOT }
						601 = { is_controlled_by = ROOT }
						602 = { is_controlled_by = ROOT }
						603 = { is_controlled_by = ROOT }
						605 = { is_controlled_by = ROOT }
						606 = { is_controlled_by = ROOT }
						607 = { is_controlled_by = ROOT }
						608 = { is_controlled_by = ROOT }
						613 = { is_controlled_by = ROOT }
						614 = { is_controlled_by = ROOT }
						620 = { is_controlled_by = ROOT }				
					}
				}
			}
			modifier = {
				add = 25
				has_idea = PRC_soviet_tribute_1
			}
			modifier = {
				add = 50
				has_idea = PRC_soviet_tribute_2
			}
			modifier = {
				add = 75
				has_idea = PRC_soviet_tribute_3
			}
			modifier = {
				add = 100
				has_idea = PRC_soviet_tribute_4
			}
			modifier = {
				add = 125
				has_idea = PRC_soviet_tribute_5
			}
			modifier = {
				add = 150
				has_idea = PRC_soviet_tribute_6
			}
			modifier = {
				factor = 0
				has_country_flag = PRC_soviet_tribute_commitment_flag
			}
		}

		visible = {
			has_country_flag = WTT_support_from_soviet
			has_soviet_tribute = yes
		}

		target_root_trigger = {
			has_country_flag = WTT_support_from_soviet
		}

		targets = { SOV }

		target_trigger = {
			FROM = { tag = SOV }
		}

		fire_only_once = yes

		complete_effect = {
			PRC_soviet_tribute_clear_all = yes
			clr_country_flag = WTT_support_from_soviet
			FROM = {
				country_event = { id = wtt_warlord_vs_prc.34 }
				effect_tooltip = {
					create_wargoal = {
						type = puppet_wargoal_focus
						target = ROOT
					}
				}
			}
		}
	}
}