####################################
# Japan 22000 - 22999 by Lothos
#		22500 - 22599 = Minister Change Events
####################################
# Who to invade flags
#	AttackChina		= Attack China
#	AttackCGX		= Attack Guang Clique
#	AttackCSX		= Attack Shanxie

# Where to invade Flags
#	ChinaCenter		= Invade the Chinese center beaches
#	ChinaSouth		= Invade the South beaches
#	ChinaNorth		= Invade the North beaches

# Air AI Flags
#	JAPAirAINaval	= Naval Priority for bombardment
#	JAPAirAIGround	= Ground support is a priority

# Misc. Flags
#	ChinaBackoff	= Backoff from his attack on China
#	ChinaBackoffSiam = Backoff from his attack on China

# Pacific War Flags
#	JAPStandardPacific	= Standard Pacific War AI
#	JAPInvadePHI		= Invade the Phillipenese
#	JAPInvadeNEPacific	= Invade the North East side of the Pacific
#	JAPInvadeNEI		= Invade the Netherlands East Indies and Singapore
#	JAPInvadeNewGuinea	= Invade New Guinea

# Homeland Defense Flags
#	JAPHomeland			= Homeland under attack

# Unit building AI
#	JAPBuildStandard	= Standard Building of units 
#	JAPBuildLand		= Priority Building land units

####################################
################
# Chinese Invasion AI
#############################################
event = {
	id = 22000
	random = no 
	country = JAP
	
	trigger = {
		ai = yes
		war = { country = JAP country = CHI }
		not = { war = { country = JAP country = USA } }
		not = { war = { country = JAP country = SOV } }
		not = { war = { country = JAP country = ENG } }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/JAP_China.ai" }
	}
}
################
# Backoff from China AI
#############################################
event = {
	id = 22001
	random = no 
	country = JAP
	
	trigger = {
		ai = yes
		ai = CHI
		war = { country = JAP country = CHI }
		not = { war = { country = JAP country = USA } }
		not = { war = { country = JAP country = SOV } }
		not = { war = { country = JAP country = ENG } }
		lost_national = { country = CHI value = 35 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/JAP_Backoff.ai" }
	}
}
################
# Pacific war
#############################################
event = {
	id = 22002
	random = no 
	country = JAP
	
	trigger = {
		ai = yes
		NOT = { ispuppet = JAP }
		NOT = { alliance = { country = JAP country = USA } }
		NOT = { alliance = { country = JAP country = ENG } }
		NOT = { alliance = { country = JAP country = HOL } }
		OR = {
			AND = {
				year = 1941
				NOT = { year = 1942 }
				event = 3800 # Oil Embargo
				OR = {
					AND = {
						month = 1
						NOT = { month = 2 }
						random = 2
					}
					AND = {
						month = 10
						random = 20
					}
				}
			}
			AND = {
				year = 1942
				event = 3800 # Oil Embargo
				OR = {
					AND = {
						month = 1
						NOT = { month = 2 }
						random = 40
					}
					AND = {
						month = 10
						random = 50
					}
				}
			}
			AND = {
				year = 1942
				atwar = no
				OR = {
					AND = {
						month = 1
						NOT = { month = 2 }
						random = 15
					}
					AND = {
						month = 10
						random = 20
					}
				}
			}
			war = { country = JAP country = USA }
			war = { country = JAP country = ENG }
			war = { country = JAP country = AST }
			war = { country = JAP country = NZL }
			war = { country = JAP country = PHI }
			war = { country = JAP country = FRA }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = sleepevent which = 22000 }
		command = { type = sleepevent which = 22001 }
		command = { type = sleepevent which = 22003 }
		command = { type = war which = USA }
		command = { type = war which = ENG }
		command = { type = war which = HOL }
	}
}
################
# Japan does not attack China AI
#############################################
event = {
	id = 22003
	random = no 
	country = JAP
	
	trigger = {
		ai = yes
		event = 20
		NOT = { war = { country = JAP country = CHI } }
	}

	name = "AI_EVENT"
	style = 0	
	
        date = { day = 0 month = june year = 1937 }
        offset = 5
	deathdate = { day = 15 month = september year = 1937 }

	action_a = {
		command = { type = ai which = "switch/JAP_Backoff.ai" }
	}
}
################
# Japan release troops for Indo China
#############################################
event = {
	id = 22004
	random = no 
	country = JAP
	
	trigger = {
		ai = yes
		OR = {
			event = 3804
			event = 3894
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/JAP_Vichy_IndoChina.ai" }
	}
}
################
# Japan loads backoff2 AI
#############################################
event = {
	id = 22005
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		ai = CHI
		NOT = { local_flag = ChinaBackoff }
		war = { country = CHI country = JAP }
		OR = {
			AND = {
				year = 1937
				NOT = { year = 1939 }
				OR = {
					AND = {
						lost_national = { country = CHI value = 35 }
						NOT = { control = { province = 1320 data = JAP } }
						NOT = { control = { province = 1321 data = JAP } }
					}
					AND = {
						lost_national = { country = CHI value = 40 }
						OR = {
							control = { province = 1320 data = JAP }
							control = { province = 1321 data = JAP }
						}
					}
				}
			}
			AND = {
				year = 1939
				NOT = { year = 1941 }
				OR = {
					AND = {
						lost_national = { country = CHI value = 38 }
						NOT = { control = { province = 1320 data = JAP } }
						NOT = { control = { province = 1321 data = JAP } }
					}
					AND = {
						lost_national = { country = CHI value = 43 }
						OR = {
							control = { province = 1320 data = JAP }
							control = { province = 1321 data = JAP }
						}
					}
				}
			}
			AND = {
				year = 1941
				OR = {
					AND = {
						lost_national = { country = CHI value = 40 }
						NOT = { control = { province = 1320 data = JAP } }
						NOT = { control = { province = 1321 data = JAP } }
					}
					AND = {
						lost_national = { country = CHI value = 45 }
						OR = {
							control = { province = 1320 data = JAP }
							control = { province = 1321 data = JAP }
						}
					}
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 0 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ChinaBackoff }
		command = { type = local_clrflag which = ChinaBackoffSiam }
		command = { type = ai which = "switch/JAP_Backoff2.ai" }
	}
}
################
# Japan goes back on the attack in China
#############################################
event = {
	id = 22006
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		ai = CHI
		local_flag = ChinaBackoff
		war = { country = CHI country = JAP }
		NOT = {
			AND = {
				year = 1937
				NOT = { year = 1939 }
				OR = {
					AND = {
						lost_national = { country = CHI value = 35 }
						NOT = { control = { province = 1320 data = JAP } }
						NOT = { control = { province = 1321 data = JAP } }
					}
					AND = {
						lost_national = { country = CHI value = 40 }
						OR = {
							control = { province = 1320 data = JAP }
							control = { province = 1321 data = JAP }
						}
					}
				}
			}
			AND = {
				year = 1939
				NOT = { year = 1941 }
				OR = {
					AND = {
						lost_national = { country = CHI value = 38 }
						NOT = { control = { province = 1320 data = JAP } }
						NOT = { control = { province = 1321 data = JAP } }
					}
					AND = {
						lost_national = { country = CHI value = 43 }
						OR = {
							control = { province = 1320 data = JAP }
							control = { province = 1321 data = JAP }
						}
					}
				}
			}
			AND = {
				year = 1941
				OR = {
					AND = {
						lost_national = { country = CHI value = 40 }
						NOT = { control = { province = 1320 data = JAP } }
						NOT = { control = { province = 1321 data = JAP } }
					}
					AND = {
						lost_national = { country = CHI value = 45 }
						OR = {
							control = { province = 1320 data = JAP }
							control = { province = 1321 data = JAP }
						}
					}
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 0 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ChinaBackoff }
		command = { type = local_clrflag which = ChinaBackoffSiam }
		command = { type = ai which = "switch/JAP_Backoff_Remove.ai" }
	}
}
################
# Japan invades China from the North
#############################################
event = {
	id = 22007
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = ChinaNorth }
		war = { country = CHI country = JAP }
		NOT = { war = { country = USA country = JAP } }
		NOT = { war = { country = ENG country = JAP } }
		OR = {
			control = { province = 1214 data = CHI }
			control = { province = 1215 data = CHI }
			control = { province = 1217 data = CHI }
			control = { province = 1219 data = CHI }
		}
		NOT = { # Central Invasion
			NOT = { ai = CHI }
			AND = {
				NOT = { control = { province = 1214 data = CHI } }
				NOT = { control = { province = 1215 data = CHI } }
				NOT = { control = { province = 1217 data = CHI } }
				NOT = { control = { province = 1219 data = CHI } }
				OR = {
					control = { province = 1244 data = CHI }
					control = { province = 1247 data = CHI }
					control = { province = 1248 data = CHI }
					control = { province = 1313 data = CHI }
					control = { province = 1314 data = CHI }
				}
			}
			AND = {
				control = { province = 1244 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1244  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1244  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1247 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1247  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1247  type = land size = 3 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1248 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1248  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1248  type = land size = 3 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1313 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1313  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1313  type = land size = 3 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1314 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1314  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1314  type = land size = 3 area = no } }
					}
				}
			}
		}
		NOT = { # Southern Invasion
			NOT = { ai = CHI }
			AND = {
				control = { province = 1321 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1321  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1321  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				war = { country = CGX country = JAP }
				control = { province = 1321 data = CGX }
				OR = {
					NOT = { garrison = { country = CGX province = 1321  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CGX province = 1321  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1320 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1320  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1320  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				war = { country = CGX country = JAP }
				control = { province = 1320 data = CGX }
				OR = {
					NOT = { garrison = { country = CGX province = 1320  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CGX province = 1320  type = land size = 2 area = no } }
					}
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ChinaCenter }
		command = { type = local_clrflag which = ChinaSouth }
		command = { type = local_setflag which = ChinaNorth }
		command = { type = ai which = "switch/JAP_China_North.ai" }
	}
}

################
# Japan invades China from the center
#############################################
event = {
	id = 22008
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { ai = CHI }
		NOT = { local_flag = ChinaCenter }
		war = { country = CHI country = JAP }
		NOT = { war = { country = USA country = JAP } }
		NOT = { war = { country = ENG country = JAP } }
		NOT = {
			AND = {
				control = { province = 1321 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1321  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1321  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				war = { country = CGX country = JAP }
				control = { province = 1321 data = CGX }
				OR = {
					NOT = { garrison = { country = CGX province = 1321  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CGX province = 1321  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1320 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1320  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1320  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				war = { country = CGX country = JAP }
				control = { province = 1320 data = CGX }
				OR = {
					NOT = { garrison = { country = CGX province = 1320  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CGX province = 1320  type = land size = 2 area = no } }
					}
				}
			}
		}
		OR = {
			AND = {
				NOT = { control = { province = 1214 data = CHI } }
				NOT = { control = { province = 1215 data = CHI } }
				NOT = { control = { province = 1217 data = CHI } }
				NOT = { control = { province = 1219 data = CHI } }
				OR = {
					control = { province = 1244 data = CHI }
					control = { province = 1247 data = CHI }
					control = { province = 1248 data = CHI }
					control = { province = 1313 data = CHI }
					control = { province = 1314 data = CHI }
				}
			}
			AND = {
				control = { province = 1244 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1244  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1244  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1247 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1247  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1247  type = land size = 3 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1248 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1248  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1248  type = land size = 3 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1313 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1313  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1313  type = land size = 3 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1314 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1314  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1314  type = land size = 3 area = no } }
					}
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ChinaCenter }
		command = { type = local_clrflag which = ChinaSouth }
		command = { type = local_clrflag which = ChinaNorth }
		command = { type = ai which = "switch/JAP_China_Center.ai" }
	}
}
################
# Japan invades China from the south
#############################################
event = {
	id = 22009
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { ai = CHI }
		NOT = { local_flag = ChinaSouth }
		war = { country = CHI country = JAP }
		NOT = { war = { country = USA country = JAP } }
		NOT = { war = { country = ENG country = JAP } }
		AND = {
			NOT = { control = { province = 1214 data = CHI } }
			NOT = { control = { province = 1215 data = CHI } }
			NOT = { control = { province = 1217 data = CHI } }
			NOT = { control = { province = 1219 data = CHI } }
		}
		OR = {
			AND = {
				NOT = { control = { province = 1244 data = CHI } }
				NOT = { control = { province = 1247 data = CHI } }
				NOT = { control = { province = 1248 data = CHI } }
			}
			AND = {
				control = { province = 1321 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1321  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1321  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				war = { country = CGX country = JAP }
				control = { province = 1321 data = CGX }
				OR = {
					NOT = { garrison = { country = CGX province = 1321  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CGX province = 1321  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				control = { province = 1320 data = CHI }
				OR = {
					NOT = { garrison = { country = CHI province = 1320  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CHI province = 1320  type = land size = 2 area = no } }
					}
				}
			}
			AND = {
				war = { country = CGX country = JAP }
				control = { province = 1320 data = CGX }
				OR = {
					NOT = { garrison = { country = CGX province = 1320  type = land size = 1 area = no } }
					AND = {
						NOT = { ai = CHI }
						NOT = { garrison = { country = CGX province = 1320  type = land size = 2 area = no } }
					}
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = ChinaCenter }
		command = { type = local_setflag which = ChinaSouth }
		command = { type = local_clrflag which = ChinaNorth }
		command = { type = ai which = "switch/JAP_China_South.ai" }
	}
}
################
# Japanese Diplomacy section
#
# Japan watches China/Warlords Diplomacy
#############################################
event = {
	id = 22010
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			local_flag = AttackChina
			war = { country = CHI country = JAP }
		}
		OR = {
			local_flag = AttackCGX
			war = { country = CGX country = JAP }
		}
		OR = {
			local_flag = AttackCSX
			war = { country = CSX country = JAP }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = AttackChina }
		command = { type = local_clrflag which = AttackCGX }
		command = { type = local_clrflag which = AttackCSX }
	}
}
################
# Japan watches China Diplomacy
#############################################
event = {
	id = 22011
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = no
		NOT = { local_flag = AttackChina }
		land_percentage = { country = CHI value = 1.0 }
		OR = {
			AND = {
				under_attack = CGX
				war = { country = CGX country = CHI }
				lost_national = { country = CGX value = 40 }
			}
			AND = {
				flag = CHI_Aggresion_Asia 
				OR = {
					AND = {
						war = { country = CGX country = CHI }
						lost_national = { country = CGX value = 50 }
					}
					NOT = { exists = CGX }
				}
			}
			AND = {
				under_attack = CXB
				war = { country = CXB country = CHI }
				lost_national = { country = CXB value = 40 }
			}
			AND = {
				under_attack = CSX
				war = { country = CSX country = CHI }
				lost_national = { country = CSX value = 40 }
			}
			AND = {
				under_attack = CYN
				war = { country = CYN country = CHI }
				lost_national = { country = CYN value = 40 }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = AttackChina }
		command = { type = ai_prepare_war which = CHI }
	}
}
################
# Japan watches Guangi Clique Diplomacy
#############################################
event = {
	id = 22012
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = no
		NOT = { local_flag = AttackCGX }
		land_percentage = { country = CGX value = 1.0 }
		OR = {
			AND = {
				under_attack = CHI
				war = { country = CGX country = CHI }
				lost_national = { country = CHI value = 50 }
			}
			AND = {
				under_attack = CSX
				war = { country = CSX country = CGX }
				lost_national = { country = CSX value = 40 }
			}
			AND = {
				under_attack = CYN
				war = { country = CYN country = CGX }
				lost_national = { country = CYN value = 40 }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = AttackCGX }
		command = { type = ai_prepare_war which = CGX }
	}
}
################
# Japan watches Guangi Clique Diplomacy
#############################################
event = {
	id = 22013
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = no
		NOT = { local_flag = AttackCSX }
		land_percentage = { country = CSX value = 1.0 }
		OR = {
			AND = {
				under_attack = CHI
				war = { country = CSX country = CHI }
				lost_national = { country = CHI value = 50 }
			}
			AND = {
				under_attack = CGX
				war = { country = CGX country = CSX }
				lost_national = { country = CGX value = 40 }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = AttackCSX }
		command = { type = ai_prepare_war which = CSX }
	}
}


################
# Japan Air AI Naval portion
#############################################
event = {
	id = 22014
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = JAPAirAINaval }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		# These statements must be false if not the land air AI has priority
		NOT = { lost_national = { country = JAP value = 2 } }
		OR = {
			war = { country = USA country = JAP }
			war = { country = PHI country = JAP }
			war = { country = HOL country = JAP }
			war = { country = ENG country = JAP }
			war = { country = FRA country = JAP }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = JAPAirAINaval }
		command = { type = local_clrflag which = JAPAirAIGround }
		command = { type = ai which = "switch/JAP_Air_Naval.ai" }
	}
}
################
# Japanese Air AI Ground portion
#############################################
event = {
	id = 22015
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = JAPAirAIGround }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		# These statements must be false if not the land air AI has priority
		OR = {
			lost_national = { country = JAP value = 2 }
			war = { country = CHI country = JAP }
			war = { country = CGX country = JAP }
			war = { country = CSX country = JAP }
			war = { country = CHC country = JAP }
			war = { country = CYN country = JAP }
			war = { country = SOV country = JAP }
		}
		NOT = {
			war = { country = USA country = JAP }
			war = { country = PHI country = JAP }
			war = { country = HOL country = JAP }
			war = { country = ENG country = JAP }
			war = { country = FRA country = JAP }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = JAPAirAINaval }
		command = { type = local_setflag which = JAPAirAIGround }
		command = { type = ai which = "switch/JAP_Air_Ground.ai" }
	}
}
################
# Event removed
#############################################
#event = {
#	id = 22016

################
# Pacific War Flags
#	JAPStandardPacific	= Standard Pacific War AI
#	JAPInvadePHI		= Invade the Phillipenese
#	JAPInvadeNEI		= Invade the Netherlands East Indies and Singapore
#	JAPInvadeNEPacific	= Invade the North East side of the Pacific
#	JAPInvadeNewGuinea	= Invade New Guinea
################
# Japanese Pacific War AIs JAPInvadePHI
#############################################
event = {
	id = 22017
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = JAPInvadePHI }
		NOT = { local_flag = JAPHomeland }
		NOT = { garrison = { country = PHI province = 1750  type = land size = 20 area = yes } } # Davao
		NOT = { garrison = { country = USA province = 1750  type = land size = 20 area = yes } } # Davao
		OR = {
			# Philippines
			AND = {
				war = { country = PHI country = JAP }
				NOT = { lost_national = { country = PHI value = 60 } }
			}
			AND = {
				owned = { province = 1735 data = JAP } # Palawan
				NOT = { control = { province = 1735 data = JAP } } # Palawan
			}
			AND = {
				owned = { province = 1736 data = JAP } # Mindoro
				NOT = { control = { province = 1736 data = JAP } } # Mindoro
			}
			AND = {
				owned = { province = 1744 data = JAP } # Samar
				NOT = { control = { province = 1744 data = JAP } } # Samar
			}
			AND = {
				owned = { province = 1745 data = JAP } # Palawan
				NOT = { control = { province = 1745 data = JAP } } # Leyte
			}
			AND = {
				owned = { province = 1749 data = JAP } # Cagayan
				NOT = { control = { province = 1749 data = JAP } } # Cagayan
			}
			AND = {
				owned = { province = 1747 data = JAP } # Negros
				NOT = { control = { province = 1747 data = JAP } } # Negros
			}
			AND = {
				owned = { province = 1750 data = JAP } # Davos
				NOT = { control = { province = 1750 data = JAP } } # Davos
			}
			AND = {
				owned = { province = 1746 data = JAP } # Panay
				NOT = { control = { province = 1746 data = JAP } } # Panay
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = JAPInvadePHI }
		command = { type = local_clrflag which = JAPInvadeNEI }
		command = { type = local_clrflag which = JAPInvadeNEPacific }
		command = { type = local_clrflag which = JAPInvadeNewGuinea }
		command = { type = local_clrflag which = JAPStandardPacific }
		command = { type = ai which = "switch/JAP_Naval_PHI.ai" }
	}
}
################
# Japanese Pacific War AIs JAPInvadeNEI
#############################################
event = {
	id = 22018
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = JAPInvadeNEI }
		NOT = { local_flag = JAPHomeland }
		OR = {
			garrison = { country = USA province = 1750  type = land size = 20 area = yes } # Davao
			garrison = { country = PHI province = 1750  type = land size = 20 area = yes } # Davao
			NOT = {
				# Philippines
				AND = {
					war = { country = PHI country = JAP }
					NOT = { lost_national = { country = PHI value = 60 } }
				}
				AND = {
					owned = { province = 1735 data = JAP } # Palawan
					NOT = { control = { province = 1735 data = JAP } } # Palawan
				}
				AND = {
					owned = { province = 1736 data = JAP } # Mindoro
					NOT = { control = { province = 1736 data = JAP } } # Mindoro
				}
				AND = {
					owned = { province = 1744 data = JAP } # Samar
					NOT = { control = { province = 1744 data = JAP } } # Samar
				}
				AND = {
					owned = { province = 1745 data = JAP } # Palawan
					NOT = { control = { province = 1745 data = JAP } } # Leyte
				}
				AND = {
					owned = { province = 1749 data = JAP } # Cagayan
					NOT = { control = { province = 1749 data = JAP } } # Cagayan
				}
				AND = {
					owned = { province = 1747 data = JAP } # Negros
					NOT = { control = { province = 1747 data = JAP } } # Negros
				}
				AND = {
					owned = { province = 1750 data = JAP } # Davos
					NOT = { control = { province = 1750 data = JAP } } # Davos
				}
				AND = {
					owned = { province = 1746 data = JAP } # Panay
					NOT = { control = { province = 1746 data = JAP } } # Panay
				}
			}
		}
		OR = {
			AND = {
				war = { country = HOL country = JAP }
				NOT = { control = { province = 1628 data = JAP } }
				NOT = { control = { province = 1641 data = JAP } }
				NOT = { control = { province = 1359 data = JAP } }
				NOT = { garrison = { country = HOL province = 1628  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1641  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1359  type = land size = 10 area = yes } }
			}
			AND = {
				war = { country = ENG country = JAP }
				NOT = { control = { province = 1353 data = JAP } }
				NOT = { garrison = { country = ENG province = 1353  type = land size = 10 area = yes } } # Singapore
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = JAPInvadePHI }
		command = { type = local_setflag which = JAPInvadeNEI }
		command = { type = local_clrflag which = JAPInvadeNEPacific }
		command = { type = local_clrflag which = JAPInvadeNewGuinea }
		command = { type = local_clrflag which = JAPStandardPacific }
		command = { type = ai which = "switch/JAP_Naval_NEI.ai" }
	}
}
################
# Japanese Pacific War AIs JAPInvadeNEPacific
#############################################
event = {
	id = 22019
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = JAPInvadeNEPacific }
		NOT = { local_flag = JAPHomeland }
		OR = {
			garrison = { country = USA province = 1750  type = land size = 20 area = yes } # Davao
			garrison = { country = PHI province = 1750  type = land size = 20 area = yes } # Davao
			NOT = {
				# Philippines
				AND = {
					war = { country = PHI country = JAP }
					NOT = { lost_national = { country = PHI value = 60 } }
				}
				AND = {
					owned = { province = 1735 data = JAP } # Palawan
					NOT = { control = { province = 1735 data = JAP } } # Palawan
				}
				AND = {
					owned = { province = 1736 data = JAP } # Mindoro
					NOT = { control = { province = 1736 data = JAP } } # Mindoro
				}
				AND = {
					owned = { province = 1744 data = JAP } # Samar
					NOT = { control = { province = 1744 data = JAP } } # Samar
				}
				AND = {
					owned = { province = 1745 data = JAP } # Palawan
					NOT = { control = { province = 1745 data = JAP } } # Leyte
				}
				AND = {
					owned = { province = 1749 data = JAP } # Cagayan
					NOT = { control = { province = 1749 data = JAP } } # Cagayan
				}
				AND = {
					owned = { province = 1747 data = JAP } # Negros
					NOT = { control = { province = 1747 data = JAP } } # Negros
				}
				AND = {
					owned = { province = 1750 data = JAP } # Davos
					NOT = { control = { province = 1750 data = JAP } } # Davos
				}
				AND = {
					owned = { province = 1746 data = JAP } # Panay
					NOT = { control = { province = 1746 data = JAP } } # Panay
				}
			}
		}
		NOT = {
			AND = {
				war = { country = HOL country = JAP }
				NOT = { control = { province = 1628 data = JAP } }
				NOT = { control = { province = 1641 data = JAP } }
				NOT = { control = { province = 1359 data = JAP } }
				NOT = { garrison = { country = HOL province = 1628  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1641  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1359  type = land size = 10 area = yes } }
			}
			AND = {
				war = { country = ENG country = JAP }
				NOT = { control = { province = 1353 data = JAP } }
				NOT = { garrison = { country = ENG province = 1353  type = land size = 10 area = yes } } # Singapore
			}
		}
		OR = {
			#Outer Japanese Islands
			NOT = { control = { province = 1627 data = JAP } } # Saipan
			NOT = { control = { province = 1626 data = JAP } } # Tinian
			NOT = { control = { province = 1625 data = JAP } } # Rota
			NOT = { control = { province = 1621 data = JAP } } # Palau
			NOT = { control = { province = 1785 data = JAP } } # Marcus Island
	
			#Far Outer Rim Japanese Islands
			NOT = { control = { province = 1601 data = JAP } } # Eniwetok
			NOT = { control = { province = 1600 data = JAP } } # Bikini
			NOT = { control = { province = 1602 data = JAP } } # Wotje
			NOT = { control = { province = 1608 data = JAP } } # Kwajalein
			NOT = { control = { province = 1603 data = JAP } } # Maloelap
			NOT = { control = { province = 1605 data = JAP } } # Majuro
			NOT = { control = { province = 1607 data = JAP } } # Jaluit
			NOT = { control = { province = 1606 data = JAP } } # Mili
			NOT = { control = { province = 1610 data = JAP } } # Ponape
			NOT = { control = { province = 1609 data = JAP } } # Kosrae
			NOT = { control = { province = 1620 data = JAP } } # Ngulu
			NOT = { control = { province = 1619 data = JAP } } # Yap
			NOT = { control = { province = 1618 data = JAP } } # Ulithi
			NOT = { control = { province = 1604 data = JAP } } # Wolelai
			NOT = { control = { province = 1615 data = JAP } } # Ulul
			NOT = { control = { province = 1617 data = JAP } } # Woleai
			NOT = { control = { province = 1616 data = JAP } } # Pulusok
			NOT = { control = { province = 1613 data = JAP } } # Truk
			NOT = { control = { province = 1612 data = JAP } } # Satawan
			AND = {
				war = { country = USA country = JAP }
				NOT = { control = { province = 1786 data = JAP } } # Wake Island
			}
			AND = {
				war = { country = USA country = JAP }
				NOT = { control = { province = 1624 data = JAP } } # Guam
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = JAPInvadePHI }
		command = { type = local_clrflag which = JAPInvadeNEI }
		command = { type = local_setflag which = JAPInvadeNEPacific }
		command = { type = local_clrflag which = JAPInvadeNewGuinea }
		command = { type = local_clrflag which = JAPStandardPacific }
		command = { type = ai which = "switch/JAP_Naval_NEPacific.ai" }
	}
}
################
# Japanese Pacific War AIs JAPInvadeNewGuinea
#############################################
event = {
	id = 22020
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = JAPInvadeNewGuinea }
		NOT = { local_flag = JAPHomeland }
		OR = {
			garrison = { country = USA province = 1750  type = land size = 20 area = yes } # Davao
			garrison = { country = PHI province = 1750  type = land size = 20 area = yes } # Davao
			NOT = {
				# Philippines
				AND = {
					war = { country = PHI country = JAP }
					NOT = { lost_national = { country = PHI value = 60 } }
				}
				AND = {
					owned = { province = 1735 data = JAP } # Palawan
					NOT = { control = { province = 1735 data = JAP } } # Palawan
				}
				AND = {
					owned = { province = 1736 data = JAP } # Mindoro
					NOT = { control = { province = 1736 data = JAP } } # Mindoro
				}
				AND = {
					owned = { province = 1744 data = JAP } # Samar
					NOT = { control = { province = 1744 data = JAP } } # Samar
				}
				AND = {
					owned = { province = 1745 data = JAP } # Palawan
					NOT = { control = { province = 1745 data = JAP } } # Leyte
				}
				AND = {
					owned = { province = 1749 data = JAP } # Cagayan
					NOT = { control = { province = 1749 data = JAP } } # Cagayan
				}
				AND = {
					owned = { province = 1747 data = JAP } # Negros
					NOT = { control = { province = 1747 data = JAP } } # Negros
				}
				AND = {
					owned = { province = 1750 data = JAP } # Davos
					NOT = { control = { province = 1750 data = JAP } } # Davos
				}
				AND = {
					owned = { province = 1746 data = JAP } # Panay
					NOT = { control = { province = 1746 data = JAP } } # Panay
				}
			}
		}
		NOT = {
			AND = {
				war = { country = HOL country = JAP }
				NOT = { control = { province = 1628 data = JAP } }
				NOT = { control = { province = 1641 data = JAP } }
				NOT = { control = { province = 1359 data = JAP } }
				NOT = { garrison = { country = HOL province = 1628  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1641  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1359  type = land size = 10 area = yes } }
			}
			AND = {
				war = { country = ENG country = JAP }
				NOT = { control = { province = 1353 data = JAP } }
				NOT = { garrison = { country = ENG province = 1353  type = land size = 10 area = yes } } # Singapore
			}
		}
		NOT = {
			#Outer Japanese Islands
			NOT = { control = { province = 1627 data = JAP } } # Saipan
			NOT = { control = { province = 1626 data = JAP } } # Tinian
			NOT = { control = { province = 1625 data = JAP } } # Rota
			NOT = { control = { province = 1621 data = JAP } } # Palau
			NOT = { control = { province = 1785 data = JAP } } # Marcus Island
	
			#Far Outer Rim Japanese Islands
			NOT = { control = { province = 1601 data = JAP } } # Eniwetok
			NOT = { control = { province = 1600 data = JAP } } # Bikini
			NOT = { control = { province = 1602 data = JAP } } # Wotje
			NOT = { control = { province = 1608 data = JAP } } # Kwajalein
			NOT = { control = { province = 1603 data = JAP } } # Maloelap
			NOT = { control = { province = 1605 data = JAP } } # Majuro
			NOT = { control = { province = 1607 data = JAP } } # Jaluit
			NOT = { control = { province = 1606 data = JAP } } # Mili
			NOT = { control = { province = 1610 data = JAP } } # Ponape
			NOT = { control = { province = 1609 data = JAP } } # Kosrae
			NOT = { control = { province = 1620 data = JAP } } # Ngulu
			NOT = { control = { province = 1619 data = JAP } } # Yap
			NOT = { control = { province = 1618 data = JAP } } # Ulithi
			NOT = { control = { province = 1604 data = JAP } } # Wolelai
			NOT = { control = { province = 1615 data = JAP } } # Ulul
			NOT = { control = { province = 1617 data = JAP } } # Woleai
			NOT = { control = { province = 1616 data = JAP } } # Pulusok
			NOT = { control = { province = 1613 data = JAP } } # Truk
			NOT = { control = { province = 1612 data = JAP } } # Satawan
			AND = {
				war = { country = USA country = JAP }
				NOT = { control = { province = 1786 data = JAP } } # Wake Island
			}
			AND = {
				war = { country = USA country = JAP }
				NOT = { control = { province = 1624 data = JAP } } # Guam
			}
		}
		war = { country = AUS country = JAP }
		war = { country = ENG country = JAP }
		OR = {
			#North New Guinea
			NOT = { control = { province = 1659 data = JAP } } # Sorong
			NOT = { control = { province = 1661 data = JAP } } # Biak Island
			NOT = { control = { province = 1660 data = JAP } } # Babo
			NOT = { control = { province = 1663 data = JAP } } # Arare
			NOT = { control = { province = 1664 data = JAP } } # Sarmi
			NOT = { control = { province = 1665 data = JAP } } # Hollandia
			NOT = { control = { province = 1666 data = JAP } } # Aitape
			NOT = { control = { province = 1667 data = JAP } } # Wewak
			NOT = { control = { province = 1672 data = JAP } } # Lae

			#North Solomon Islands
			NOT = { control = { province = 1668 data = JAP } } # Admirality Islands
			NOT = { control = { province = 1669 data = JAP } } # New Ireland
			NOT = { control = { province = 1681 data = JAP } } # Buka Island
			NOT = { control = { province = 1682 data = JAP } } # Bougainville

			#New Britain
			NOT = { control = { province = 1670 data = JAP } } # Rabaul
			NOT = { control = { province = 1671 data = JAP } } # Gasmata
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = JAPInvadePHI }
		command = { type = local_clrflag which = JAPInvadeNEI }
		command = { type = local_clrflag which = JAPInvadeNEPacific }
		command = { type = local_setflag which = JAPInvadeNewGuinea }
		command = { type = local_clrflag which = JAPStandardPacific }
		command = { type = ai which = "switch/JAP_Naval_NewGuinea.ai" }
	}
}
################
# Japanese Pacific War AIs JAPStandardPacific
#############################################
event = {
	id = 22021
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = JAPStandardPacific }
		NOT = { local_flag = JAPHomeland }
		OR = {
			war = { country = AUS country = JAP }
			war = { country = ENG country = JAP }
			war = { country = FRA country = JAP }
			war = { country = NZL country = JAP }
			war = { country = PHI country = JAP }
			war = { country = USA country = JAP }
			war = { country = HOL country = JAP }
		}
		OR = {
			garrison = { country = USA province = 1750  type = land size = 20 area = yes } # Davao
			garrison = { country = PHI province = 1750  type = land size = 20 area = yes } # Davao
			NOT = {
				# Philippines
				AND = {
					war = { country = PHI country = JAP }
					NOT = { lost_national = { country = PHI value = 60 } }
				}
				AND = {
					owned = { province = 1735 data = JAP } # Palawan
					NOT = { control = { province = 1735 data = JAP } } # Palawan
				}
				AND = {
					owned = { province = 1736 data = JAP } # Mindoro
					NOT = { control = { province = 1736 data = JAP } } # Mindoro
				}
				AND = {
					owned = { province = 1744 data = JAP } # Samar
					NOT = { control = { province = 1744 data = JAP } } # Samar
				}
				AND = {
					owned = { province = 1745 data = JAP } # Palawan
					NOT = { control = { province = 1745 data = JAP } } # Leyte
				}
				AND = {
					owned = { province = 1749 data = JAP } # Cagayan
					NOT = { control = { province = 1749 data = JAP } } # Cagayan
				}
				AND = {
					owned = { province = 1747 data = JAP } # Negros
					NOT = { control = { province = 1747 data = JAP } } # Negros
				}
				AND = {
					owned = { province = 1750 data = JAP } # Davos
					NOT = { control = { province = 1750 data = JAP } } # Davos
				}
				AND = {
					owned = { province = 1746 data = JAP } # Panay
					NOT = { control = { province = 1746 data = JAP } } # Panay
				}
			}
		}
		NOT = {
			AND = {
				war = { country = HOL country = JAP }
				NOT = { control = { province = 1628 data = JAP } }
				NOT = { control = { province = 1641 data = JAP } }
				NOT = { control = { province = 1359 data = JAP } }
				NOT = { garrison = { country = HOL province = 1628  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1641  type = land size = 10 area = yes } }
				NOT = { garrison = { country = HOL province = 1359  type = land size = 10 area = yes } }
			}
			AND = {
				war = { country = ENG country = JAP }
				NOT = { control = { province = 1353 data = JAP } }
				NOT = { garrison = { country = ENG province = 1353  type = land size = 10 area = yes } } # Singapore
			}
		}
		NOT = {
			#Outer Japanese Islands
			NOT = { control = { province = 1627 data = JAP } } # Saipan
			NOT = { control = { province = 1626 data = JAP } } # Tinian
			NOT = { control = { province = 1625 data = JAP } } # Rota
			NOT = { control = { province = 1621 data = JAP } } # Palau
			NOT = { control = { province = 1785 data = JAP } } # Marcus Island
	
			#Far Outer Rim Japanese Islands
			NOT = { control = { province = 1601 data = JAP } } # Eniwetok
			NOT = { control = { province = 1600 data = JAP } } # Bikini
			NOT = { control = { province = 1602 data = JAP } } # Wotje
			NOT = { control = { province = 1608 data = JAP } } # Kwajalein
			NOT = { control = { province = 1603 data = JAP } } # Maloelap
			NOT = { control = { province = 1605 data = JAP } } # Majuro
			NOT = { control = { province = 1607 data = JAP } } # Jaluit
			NOT = { control = { province = 1606 data = JAP } } # Mili
			NOT = { control = { province = 1610 data = JAP } } # Ponape
			NOT = { control = { province = 1609 data = JAP } } # Kosrae
			NOT = { control = { province = 1620 data = JAP } } # Ngulu
			NOT = { control = { province = 1619 data = JAP } } # Yap
			NOT = { control = { province = 1618 data = JAP } } # Ulithi
			NOT = { control = { province = 1604 data = JAP } } # Wolelai
			NOT = { control = { province = 1615 data = JAP } } # Ulul
			NOT = { control = { province = 1617 data = JAP } } # Woleai
			NOT = { control = { province = 1616 data = JAP } } # Pulusok
			NOT = { control = { province = 1613 data = JAP } } # Truk
			NOT = { control = { province = 1612 data = JAP } } # Satawan
			AND = {
				war = { country = USA country = JAP }
				NOT = { control = { province = 1786 data = JAP } } # Wake Island
			}
			AND = {
				war = { country = USA country = JAP }
				NOT = { control = { province = 1624 data = JAP } } # Guam
			}
		}
		NOT = {
			#North New Guinea
			NOT = { control = { province = 1659 data = JAP } } # Sorong
			NOT = { control = { province = 1661 data = JAP } } # Biak Island
			NOT = { control = { province = 1660 data = JAP } } # Babo
			NOT = { control = { province = 1663 data = JAP } } # Arare
			NOT = { control = { province = 1664 data = JAP } } # Sarmi
			NOT = { control = { province = 1665 data = JAP } } # Hollandia
			NOT = { control = { province = 1666 data = JAP } } # Aitape
			NOT = { control = { province = 1667 data = JAP } } # Wewak
			NOT = { control = { province = 1672 data = JAP } } # Lae

			#North Solomon Islands
			NOT = { control = { province = 1668 data = JAP } } # Admirality Islands
			NOT = { control = { province = 1669 data = JAP } } # New Ireland
			NOT = { control = { province = 1681 data = JAP } } # Buka Island
			NOT = { control = { province = 1682 data = JAP } } # Bougainville

			#New Britain
			NOT = { control = { province = 1670 data = JAP } } # Rabaul
			NOT = { control = { province = 1671 data = JAP } } # Gasmata
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = JAPInvadePHI }
		command = { type = local_clrflag which = JAPInvadeNEI }
		command = { type = local_clrflag which = JAPInvadeNEPacific }
		command = { type = local_clrflag which = JAPInvadeNewGuinea }
		command = { type = local_setflag which = JAPStandardPacific }
		command = { type = ai which = "switch/JAP_Naval_Pacific.ai" }
	}
}
################
# Japan loads Standard builds AI
#############################################
event = {
	id = 22022
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			atwar = yes
			event = 20 # Marco Polo
		}
		NOT = { local_flag = JAPBuildStandard }
		NOT = {
			AND = {
				war = { country = CHI country = JAP }
				NOT = { land_percentage = { country = CHI value = 1.2 } }
			}
			AND = {
				war = { country = USA country = JAP }
				NOT = { land_percentage = { country = USA value = 0.5 } }
			}
			AND = {
				war = { country = AUS country = JAP }
				NOT = { land_percentage = { country = AUS value = 1.0 } }
			}
			AND = {
				war = { country = ENG country = JAP }
				NOT = { land_percentage = { country = ENG value = 1.0 } }
			}
			AND = {
				war = { country = SOV country = JAP }
				NOT = { land_percentage = { country = SOV value = 0.4 } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = JAPBuildStandard }
		command = { type = local_clrflag which = JAPBuildLand }
		command = { type = ai which = "switch/JAP_Build_Standard.ai" }
	}
}
################
# Japan loads Land builds AI
#############################################
event = {
	id = 22023
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			atwar = yes
			event = 20 # Marco Polo
		}
		NOT = { local_flag = JAPBuildLand }
		OR = {
			AND = {
				war = { country = CHI country = JAP }
				NOT = { land_percentage = { country = CHI value = 1.2 } }
			}
			AND = {
				war = { country = USA country = JAP }
				NOT = { land_percentage = { country = USA value = 0.5 } }
			}
			AND = {
				war = { country = AUS country = JAP }
				NOT = { land_percentage = { country = AUS value = 1.0 } }
			}
			AND = {
				war = { country = ENG country = JAP }
				NOT = { land_percentage = { country = ENG value = 1.0 } }
			}
			AND = {
				war = { country = SOV country = JAP }
				NOT = { land_percentage = { country = SOV value = 0.4 } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = JAPBuildStandard }
		command = { type = local_setflag which = JAPBuildLand }
		command = { type = ai which = "switch/JAP_Build_Land.ai" }
	}
}
################
# Homeland Defense Flags
#	JAPHomeland			= Homeland under attack
################
# Japan Homeland defense AI
#############################################
event = {
	id = 22024
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			atwar = yes
			event = 20 # Marco Polo
		}
		NOT = { local_flag = JAPHomeland }
		OR = {
			# Japan
			AND = {
				owned = { province = 1188 data = JAP } # Hiroshima
				NOT = { control = { province = 1188 data = JAP } } # Hiroshima
			}
			AND = {
				owned = { province = 1187 data = JAP } # Osaka
				NOT = { control = { province = 1187 data = JAP } } # Osaka
			}
			AND = {
				owned = { province = 1186 data = JAP } # Kanazawa
				NOT = { control = { province = 1186 data = JAP } } # Kanazawa
			}
			AND = {
				owned = { province = 1185 data = JAP } # Nagoya
				NOT = { control = { province = 1185 data = JAP } } # Nagoya
			}
			AND = {
				owned = { province = 1184 data = JAP } # Tokyo
				NOT = { control = { province = 1184 data = JAP } } # Tokyo
			}
			AND = {
				owned = { province = 1183 data = JAP } # Niigata
				NOT = { control = { province = 1183 data = JAP } } # Niigata
			}
			AND = {
				owned = { province = 1182 data = JAP } # Fukushima
				NOT = { control = { province = 1182 data = JAP } } # Fukushima
			}
			AND = {
				owned = { province = 1181 data = JAP } # Akita
				NOT = { control = { province = 1181 data = JAP } } # Akita
			}
			AND = {
				owned = { province = 1180 data = JAP } # Sendai
				NOT = { control = { province = 1180 data = JAP } } # Sendai
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = JAPHomeland }
		command = { type = local_clrflag which = JAPBuildStandard }
		command = { type = local_clrflag which = JAPBuildLand }
		command = { type = local_clrflag which = JAPInvadePHI }
		command = { type = local_clrflag which = JAPInvadeNEI }
		command = { type = local_clrflag which = JAPInvadeNEPacific }
		command = { type = local_clrflag which = JAPInvadeNewGuinea }
		command = { type = local_clrflag which = JAPStandardPacific }
		command = { type = ai which = "switch/JAP_Homeland.ai" }
	}
}
################
# Japan Rescinds Homelands defense AI
#############################################
event = {
	id = 22025
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			atwar = yes
			event = 20 # Marco Polo
		}
		local_flag = JAPHomeland
		NOT = {
			# Japan
			AND = {
				owned = { province = 1188 data = JAP } # Hiroshima
				NOT = { control = { province = 1188 data = JAP } } # Hiroshima
			}
			AND = {
				owned = { province = 1187 data = JAP } # Osaka
				NOT = { control = { province = 1187 data = JAP } } # Osaka
			}
			AND = {
				owned = { province = 1186 data = JAP } # Kanazawa
				NOT = { control = { province = 1186 data = JAP } } # Kanazawa
			}
			AND = {
				owned = { province = 1185 data = JAP } # Nagoya
				NOT = { control = { province = 1185 data = JAP } } # Nagoya
			}
			AND = {
				owned = { province = 1184 data = JAP } # Tokyo
				NOT = { control = { province = 1184 data = JAP } } # Tokyo
			}
			AND = {
				owned = { province = 1183 data = JAP } # Niigata
				NOT = { control = { province = 1183 data = JAP } } # Niigata
			}
			AND = {
				owned = { province = 1182 data = JAP } # Fukushima
				NOT = { control = { province = 1182 data = JAP } } # Fukushima
			}
			AND = {
				owned = { province = 1181 data = JAP } # Akita
				NOT = { control = { province = 1181 data = JAP } } # Akita
			}
			AND = {
				owned = { province = 1180 data = JAP } # Sendai
				NOT = { control = { province = 1180 data = JAP } } # Sendai
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = JAPHomeland }
		command = { type = ai which = "switch/JAP_Homeland_Rescind.ai" }
	}
}
################
# Japan builds transports
#############################################
event = {
	id = 22026
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		atwar = yes
		NOT = { transport = { country = JAP value = 10 } }
		NOT = {
			# Japan
			AND = {
				owned = { province = 1188 data = JAP } # Hiroshima
				NOT = { control = { province = 1188 data = JAP } } # Hiroshima
			}
			AND = {
				owned = { province = 1187 data = JAP } # Osaka
				NOT = { control = { province = 1187 data = JAP } } # Osaka
			}
			AND = {
				owned = { province = 1186 data = JAP } # Kanazawa
				NOT = { control = { province = 1186 data = JAP } } # Kanazawa
			}
			AND = {
				owned = { province = 1185 data = JAP } # Nagoya
				NOT = { control = { province = 1185 data = JAP } } # Nagoya
			}
			AND = {
				owned = { province = 1184 data = JAP } # Tokyo
				NOT = { control = { province = 1184 data = JAP } } # Tokyo
			}
			AND = {
				owned = { province = 1183 data = JAP } # Niigata
				NOT = { control = { province = 1183 data = JAP } } # Niigata
			}
			AND = {
				owned = { province = 1182 data = JAP } # Fukushima
				NOT = { control = { province = 1182 data = JAP } } # Fukushima
			}
			AND = {
				owned = { province = 1181 data = JAP } # Akita
				NOT = { control = { province = 1181 data = JAP } } # Akita
			}
			AND = {
				owned = { province = 1180 data = JAP } # Sendai
				NOT = { control = { province = 1180 data = JAP } } # Sendai
			}
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = build_division which = transport }
	}
}
################
# Japan loads backoff2 AI
#############################################
event = {
	id = 22027
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		ai = CHI
		local_flag = ChinaBackoff
		NOT = { local_flag = ChinaBackoffSiam }
		OR = {
			alliance = { country = JAP country = SIA }
			AND = {
				owned = { province = 1326 data = JAP }
				control = { province = 1326 data = JAP }
			}
			AND = {
				owned = { province = 1306 data = JAP }
				control = { province = 1306 data = JAP }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 0 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ChinaBackoffSiam }
		command = { type = ai which = "switch/JAP_Backoff2_Siam.ai" }
	}
}
################
# Japan goes back on the attack in China
#############################################
event = {
	id = 22028
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		ai = CHI
		NOT = { local_flag = ChinaBackoff }
		NOT = { local_flag = ChinaBackoffSiam }
		OR = {
			alliance = { country = JAP country = SIA }
			AND = {
				owned = { province = 1326 data = JAP }
				control = { province = 1326 data = JAP }
			}
			AND = {
				owned = { province = 1306 data = JAP }
				control = { province = 1306 data = JAP }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 0 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = ChinaBackoffSiam }
		command = { type = ai which = "switch/JAP_Backoff_Remove_Siam.ai" }
	}
}
################
# Japan builds Fortifications
#############################################
event = {
	id = 22029
	random = no
	country = JAP

	trigger = {
		ai = yes
		technology = 5100
		control = { province = 1613 data = JAP } # Truk
		control = { province = 1599 data = JAP } # Iwo Jima
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1939 }

	action_a = {
		command = { type = ai which = "switch/JAP_Build_Fort.ai" }
	}
}
################
# Japan retools production
#############################################
event = {
	id = 22030
	random = no
	country = JAP

	trigger = {
		ai = yes
		OR = {
			war = { country = JAP country = USA }
			war = { country = JAP country = SOV }
			war = { country = JAP country = PHI }
			war = { country = JAP country = ENG }
			war = { country = JAP country = FRA }
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1939 }

	action_a = {
		command = { type = ai which = "switch/JAP_Build_Fort_Stop.ai" }
		command = { type = sleepevent which = 22029 }
	}
}
################
# Japan builds carriers
#############################################
event = {
	id = 22031
	random = no
	country = JAP

	trigger = {
		ai = yes
		NOT = { local_flag = JAPHomeland }
		NOT = { carrier = { country = JAP value = 10 } }
		OR = {
			atwar = yes
			year = 1939
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = build_division which = carrier value = cag }
	}
}
################
# Japan builds Submarines
#############################################
event = {
	id = 22032
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		NOT = { local_flag = JAPHomeland }
		NOT = { submarine = { country = JAP value = 6 } }
		OR = {
			atwar = yes
			year = 1939
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = build_division which = submarine }
	}
}
################
# Japan AI Slider manipulation
#
#	Free Market
#############################################
event = { # Free Market
	id = 22033
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = free_market value = 1}
		government = democratic
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = free_market value = 1 }
	}
}
event = { # Free Market
	id = 22034
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = free_market value = -1}
		OR = {
			government = fascist
			government = communist
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = free_market value = -1 }
	}
}
################
#	Open Society
#############################################
event = { # Open Society
	id = 22035
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = freedom value = -1}
		AND = {
			domestic = { type = freedom value = 0 }
			OR = {
				government = fascist
				government = communist
			}
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = freedom value = -1 }
	}
}
event = { # Open Society
	id = 22036
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = freedom value = 1}
		AND = {
			NOT = { domestic = { type = freedom value = 9 } }
			government = democratic
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = freedom value = 1 }
	}
}
################
#	Standing Army
#############################################
event = { # Standing Army
	id = 22037
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = professional_army value = 1}
		AND = {
			NOT = { domestic = { type = professional_army value = 9 } }
			OR = {
				government = fascist
				government = communist
			}
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = professional_army value = 1 }
	}
}
event = { # Standing Army
	id = 22038
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = professional_army value = -1}
		AND = {
			domestic = { type = professional_army value = 0 }
			government = democratic
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = professional_army value = -1 }
	}
}
################
#	Hawk Lobby
#############################################
event = { # Hawk Lobby
	id = 22039
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = defense_lobby value = 1}
		AND = {
			NOT = { domestic = { type = defense_lobby value = 9 } }
			OR = {
				government = fascist
				government = communist
			}
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = defense_lobby value = 1 }
	}
}
event = { # Hawk Lobby
	id = 22040
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = defense_lobby value = -1}
		AND = {
			domestic = { type = defense_lobby value = 0 }
			government = democratic
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = defense_lobby value = -1 }
	}
}
################
#	Interventionism
#############################################
event = { # Interventionism
	id = 22041
	random = no
	country = JAP
	persistent = yes

	trigger = {
		ai = yes
		can_change_policy = {type = interventionism value = 1}
		NOT = { domestic = { type = interventionism value = 9 } }
		OR = {
			atwar = yes
			government = fascist
			government = communist
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1955 }

	action_a = {
		command = { type = change_policy which = interventionism value = 1 }
	}
}









####################################
# Japan 22500 - 22599 = Minister Change Events
####################################
################
# Minister of Security Section 22500 - 22509
#############################################
event = { # Ushio Shigenosuke takes power
	id = 22500
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 5105 # Ushio Shigenosuke
		NOT = { InCabinet = 5105 }
		OR = {
			NOT = { war = { country = JAP country = CHI } }
			NOT = {
				war = { country = JAP country = CHI }
				OR = {
						minister = 5115 # Fujie Keisuke
						minister = 5123 # Tojo Hideki
				}
				OR = {
					lost_national = { country = CHI value = 10 }
					control = { province = 125 data = JAP } # Nanjing
				}
			}
		}
		OR = {
			manpower = 200
			NOT = { minister = 5099 } # Kawarada Kakichi
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ministerofsecurity which = 5105 }
		command = { type = dissent value = -1 }
	}
}
event = { # Goto Fumio takes power
	id = 22501
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { minister = 5105 } # Ushio Shigenosuke
		minister = 5005 # Goto Fumio
		NOT = { InCabinet = 5005 }
		OR = {
			NOT = { war = { country = JAP country = CHI } }
			NOT = {
				war = { country = JAP country = CHI }
				OR = {
						minister = 5115 # Fujie Keisuke
						minister = 5123 # Tojo Hideki
				}
				OR = {
					lost_national = { country = CHI value = 10 }
					control = { province = 125 data = JAP } # Nanjing
				}
			}
		}
		OR = {
			manpower = 200
			NOT = { minister = 5099 } # Kawarada Kakichi
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ministerofsecurity which = 5005 }
		command = { type = dissent value = -1 }
	}
}
event = { # Kawarada Kakichi takes power
	id = 22502
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { manpower = 200 }
		minister = 5099 # Kawarada Kakichi
		NOT = { InCabinet = 5099 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ministerofsecurity which = 5099 }
		command = { type = dissent value = -1 }
	}
}
event = { # Tojo Hideki takes power
	id = 22503
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 5123 # Tojo Hideki
		NOT = { InCabinet = 5123 }
		war = { country = JAP country = CHI }
		OR = {
			lost_national = { country = CHI value = 10 }
			control = { province = 125 data = JAP } # Nanjing
		}
		OR = {
			manpower = 200
			NOT = { minister = 5099 } # Kawarada Kakichi
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ministerofsecurity which = 5123 }
		command = { type = dissent value = -1 }
	}
}
event = { # Fujie Keisuke takes power
	id = 22504
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 5115 # Fujie Keisuke
		NOT = { InCabinet = 5115 }
		NOT = { minister = 5123 } # Tojo Hideki
		war = { country = JAP country = CHI }
		OR = {
			lost_national = { country = CHI value = 10 }
			control = { province = 125 data = JAP } # Nanjing
		}
		OR = {
			manpower = 200
			NOT = { minister = 5099 } # Kawarada Kakichi
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ministerofsecurity which = 5115 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of Staff Section 22510 - 22519
#############################################
event = { # Kanichiro Tashiro takes power
	id = 22510
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		minister = 5150 # Kanichiro Tashiro
		NOT = { InCabinet = 5150 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofstaff which = 5150 }
		command = { type = dissent value = -1 }
	}
}
event = { # Sugiyama Hajime takes power
	id = 22511
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		NOT = { minister = 5150 } # Kanin Kotohito
		minister = 5155 # Sugiyama Hajime
		NOT = { InCabinet = 5155 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofstaff which = 5155 }
		command = { type = dissent value = -1 }
	}
}
event = { # Hirotsugu Hayashida takes power
	id = 22512
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = no
		minister = 5149 # Hirotsugu Hayashida
		NOT = { InCabinet = 5149 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofstaff which = 5149 }
		command = { type = dissent value = -1 }
	}
}
################
# Head of Intelligence Section 22520 - 22529
#############################################
event = { # Takasu Shiro takes power
	id = 22520
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 5134 # Takasu Shiro
		NOT = { InCabinet = 5134 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ministerofintelligence which = 5134 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of the Army Section 22530 - 22539
#############################################
event = { # Sugiyama Hajime takes power
	id = 22530
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		minister = 5165 # Sugiyama Hajime
		NOT = { InCabinet = 5165 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofarmy which = 5165 }
		command = { type = dissent value = -1 }
	}
}
event = { # Inanba Satoru takes power
	id = 22531
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = no
		minister = 5160 # Inanba Satoru
		NOT = { InCabinet = 5160 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofarmy which = 5160 }
		command = { type = dissent value = -1 }
	}
}
################
# Armament Minister Section 22540 - 22549
#############################################
event = { # Fujiwara Ginjiro takes power
	id = 22540
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 5084 # Fujiwara Ginjiro
		NOT = { InCabinet = 5084 }
		OR = {
			war = { country = JAP country = USA }
			war = { country = JAP country = ENG }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = armamentminister which = 5084 }
		command = { type = dissent value = -1 }
	}
}
event = { # Hatta Yoshiaki takes power
	id = 22541
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 5082 # Hatta Yoshiaki
		NOT = { InCabinet = 5082 }
		OR = {
			NOT = { minister = 5084 } # Fujiwara Ginjiro
			AND = {
				minister = 5084 # Fujiwara Ginjiro
				NOT = { war = { country = JAP country = USA } }
				NOT = { war = { country = JAP country = ENG } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = armamentminister which = 5082 }
		command = { type = dissent value = -1 }
	}
}
event = { # Shoda Kazue takes power
	id = 22542
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 5090 # Shoda Kazue
		NOT = { InCabinet = 5090 }
		OR = {
			AND = {
				NOT = { minister = 5082 } # Hatta Yoshiaki
				NOT = { minister = 5084 } # Fujiwara Ginjiro
			}
			AND = {
				NOT = { minister = 5082 } # Hatta Yoshiaki
				minister = 5084 # Fujiwara Ginjiro
				NOT = { war = { country = JAP country = USA } }
				NOT = { war = { country = JAP country = ENG } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = armamentminister which = 5090 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of Air Minister Section 22550 - 22559
# Air AI Flags
#	JAPAirAINaval	= Naval Priority for bombardment
#	JAPAirAIGround	= Ground support is a priority
#############################################
event = { # Yamamoto Isoroku takes power
	id = 22550
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = JAPAirAINaval
		minister = 5010 # Yamamoto Isoroku
		NOT = { InCabinet = 5010 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofair which = 5010 }
		command = { type = dissent value = -1 }
	}
}
event = { # Inoue Shigeyoshi takes power
	id = 22551
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = JAPAirAINaval
		minister = 5180 # Inoue Shigeyoshi
		NOT = { InCabinet = 5180 }
		NOT = { minister = 5010 } # Yamamoto Isoroku
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofair which = 5180 }
		command = { type = dissent value = -1 }
	}
}
event = { # Tojo Hideki takes power
	id = 22552
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = JAPAirAIGround
		minister = 5191 # Tojo Hideki
		NOT = { InCabinet = 5191 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofair which = 5191 }
		command = { type = dissent value = -1 }
	}
}
event = { # Tsukahara Nishizou takes power
	id = 22553
	random = no 
	country = JAP
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = JAPAirAIGround
		minister = 5181 # Tsukahara Nishizou
		NOT = { InCabinet = 5181 }
		NOT = { minister = 5191 } # Tojo Hideki
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = chiefofair which = 5181 }
		command = { type = dissent value = -1 }
	}
}
