#historical events for hearts of iron 4 - initially created by CSRZ for 1.7.1 Hydra/Man the Guns
#events for the Soviet AI that puppets Chinese Warlords instead of feeding Mao

add_namespace = chinaoverhaul

#Shanxi Soviet puppet joins PRC
country_event = {
	id = chinaoverhaul.1

	trigger = {
		tag = SHX
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = SHX
				transfer_troops = yes
			}
		}
	}
}

#Guanxi Soviet puppet joins PRC
country_event = {
	id = chinaoverhaul.2

	trigger = {
		tag = GXC
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = GXC
				transfer_troops = yes
			}
		}
	}
}

#Manchukuo Soviet puppet joins PRC
country_event = {
	id = chinaoverhaul.3

	trigger = {
		tag = MAN
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = MAN
				transfer_troops = yes
			}
		}
	}
}

#Yunaan Soviet puppet joins PRC
country_event = {
	id = chinaoverhaul.4

	trigger = {
		tag = YUN
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = YUN
				transfer_troops = yes
			}
		}
	}
}

#Sinkiang Soviet puppet joins PRC
#country_event = {
#	id = chinaoverhaul.5
#
#	trigger = {
#		tag = SIK
#		NOT = { has_global_flag = disable_AI_tweaks_hiep }
#		is_ai = yes
#		is_subject_of = SOV
#		SOV = { is_ai = yes }
#		has_government = communism
#	}
#
#	mean_time_to_happen = {
#		days = 2
#	}
#
#	hidden = yes
#
#	immediate = {
#		release = PRC
#	}
#}

#XSM Soviet puppet joins PRC
country_event = {
	id = chinaoverhaul.6

	trigger = {
		tag = XSM
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = XSM
				transfer_troops = yes
			}
		}
	}
}

#Mengukuo Soviet puppet joins PRC
country_event = {
	id = chinaoverhaul.7

	trigger = {
		tag = MEN
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = MEN
				transfer_troops = yes
			}
		}
	}
}

#China Soviet puppet joins PRC
country_event = {
	id = chinaoverhaul.8

	trigger = {
		tag = CHI
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = CHI
				transfer_troops = yes
			}
		}
	}
}

#Shanxi is integrated into communist China on capitulation
country_event = {
	id = chinaoverhaul.11

	trigger = {
		tag = SHX
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		has_capitulated = yes
		is_in_faction_with = PRC
		PRC = { has_capitulated = no }
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = SHX
				transfer_troops = yes
			}
		}
	}
}

#Guanxi is integrated into nationalist China on capitulation
country_event = {
	id = chinaoverhaul.12

	trigger = {
		tag = GXC
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		has_capitulated = yes
		is_in_faction_with = CHI
		CHI = { has_capitulated = no }
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		CHI = {
			annex_country = {
				target = GXC
				transfer_troops = yes
			}
		}
	}
}

#Shanxi is integrated into communist China anyway
country_event = {
	id = chinaoverhaul.13

	trigger = {
		tag = SHX
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		date > 1943.1.1
		PRC = { is_ai = yes }
		is_in_faction_with = PRC
		PRC = { has_capitulated = no }
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = SHX
				transfer_troops = yes
			}
		}
	}
}

#Guandong is integrated into nationalist China on capitulation
country_event = {
	id = chinaoverhaul.14

	trigger = {
		tag = GDC
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		has_capitulated = yes
		is_in_faction_with = CHI
		CHI = { has_capitulated = no }
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		CHI = {
			annex_country = {
				target = GDC
				transfer_troops = yes
			}
		}
	}
}

#new Chinese Soviet puppets join PRC
country_event = {
	id = chinaoverhaul.21

	trigger = {
		tag = KUM
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		SIK = {
			annex_country = {
				target = KUM
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.22

	trigger = {
		tag = GSM
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = GSM
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.23

	trigger = {
		tag = GDC
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = GDC
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.24

	trigger = {
		tag = KHM
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = KHM
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.25

	trigger = {
		tag = NXM
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = NXM
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.26

	trigger = {
		tag = SND
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = SND
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.27

	trigger = {
		tag = SIC
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = SIC
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.28

	trigger = {
		tag = XIC
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = XIC
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.29

	trigger = {
		tag = RNG
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = RNG
				transfer_troops = yes
			}
		}
	}
}

country_event = {
	id = chinaoverhaul.30

	trigger = {
		tag = HBC
		NOT = { has_global_flag = disable_AI_tweaks_hiep }
		is_ai = yes
		is_subject_of = SOV
		SOV = { is_ai = yes }
		has_government = communism
	}

	mean_time_to_happen = {
		days = 2
	}

	hidden = yes

	immediate = {
		PRC = {
			annex_country = {
				target = HBC
				transfer_troops = yes
			}
		}
	}
}