#Category allowed for JAP
JAP_intervene_in_china = {

	JAP_china_step_up_war_effort = {

		icon = jap_conquer_china

		available = {
			JAP_has_idea_JAP_intervene_in_china = yes
		}

		visible = {
			JAP_has_idea_JAP_intervene_in_china = yes
			any_enemy_country = {
				is_literally_china = yes
			}
		} 

		fire_only_once = no

		ai_will_do = {
			factor = 201
			modifier = {
				has_war_with = USA
				factor = 10 #screw it, kill everything
			}
			modifier = {
				factor = 0
				has_country_flag = JAP_slow_down_in_china
				#NOT = { has_war_with = USA }
			}
		}
		modifier = {

		}

		days_remove = 14
		days_re_enable = 120

		cost = 5

		complete_effect = {

			JAP_intervene_in_china_level_down = yes
			hidden_effect = {
				set_country_flag = { flag = JAP_slow_down_in_china value = 1 days = 90 }
			}
		}
	}

	JAP_ichi_go = {

		icon = jap_conquer_china

		available = {	
			event_target:WTT_current_china_leader = {
				has_capitulated = no
				exists = yes
			}
		}

		visible = {
			has_completed_focus = JAP_secure_china
			any_enemy_country = {
				is_literally_china = yes
			}
			event_target:WTT_current_china_leader = {
				NOT = { is_puppet_of = JAP }
			}
		}

		fire_only_once = yes

		ai_will_do = {
			factor = 1
			modifier = {
				is_historical_focus_on = yes
				date < 1943.6.6
				controls_state = 609 #East Heibei, to ensure that Japan hasn't been kicked off the mainland
				factor = 0
			}
		}

		cost = 50

		complete_effect = {

			add_ideas = JAP_ichi_go
			activate_mission_tooltip = JAP_conquer_china
			set_country_flag = JAP_conquer_china_activate
		}
	}

	JAP_conquer_china = {

		icon = jap_conquer_china

		available = {
			event_target:WTT_current_china_leader = {
				OR = {
					has_capitulated = yes
					exists = no
					is_subject_of = ROOT
				}
			}
		}

		visible = {
			JAP_has_idea_JAP_intervene_in_china = yes
			any_enemy_country = {
				is_literally_china = yes
			}
		}

		activation = {
			has_country_flag = JAP_conquer_china_activate
		}

		fire_only_once = yes

		is_good = no

		days_mission_timeout = 360
		
		timeout_effect = {
			add_stability = -0.1
			add_war_support = -0.1
		}

		complete_effect = {
			add_stability = 0.05
			add_war_support = 0.05
		}
	}

	
}

JAP_interservice_rivalry = {
	JAP_steel_for_guns = {

		icon = generic_tank

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_steel_for_ships
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_steel_for_ships
			}
		}
		cost = 30
		fire_only_once = yes
		days_remove = -1
		ai_will_do = {
			factor = 4
		}
		complete_effect = {
			random_owned_state = {
				limit = {
					is_controlled_by = ROOT
					is_core_of = ROOT
					free_building_slots = {
						building = arms_factory
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
			}
			random_owned_state = {
				limit = {
					is_controlled_by = ROOT
					is_core_of = ROOT
					free_building_slots = {
						building = arms_factory
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
			}
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			JAP_interservice_rivalry_towards_army = yes
			set_country_flag = JAP_steel_for_guns
		}
	}
	JAP_steel_for_ships = {

		icon = generic_naval

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_steel_for_guns
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_steel_for_guns
			}
		}
		cost = 30
		fire_only_once = yes
		days_remove = -1
		ai_will_do = {
			factor = 1
		}
		complete_effect = {
			random_owned_state = {
				limit = {
					is_controlled_by = ROOT
					is_core_of = ROOT
					free_building_slots = {
						building = dockyard
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = dockyard
					level = 2
					instant_build = yes
				}
			}
			random_owned_state = {
				limit = {
					is_controlled_by = ROOT
					is_core_of = ROOT
					free_building_slots = {
						building = dockyard
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = dockyard
					level = 2
					instant_build = yes
				}
			}
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			JAP_interservice_rivalry_towards_navy = yes
			set_country_flag = JAP_steel_for_ships
		}
	}
	JAP_prioritize_army_aircraft_construction = {

		icon = generic_tank

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_prioritize_naval_aircraft_construction
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_prioritize_naval_aircraft_construction
			}
		}
		cost = 30
		fire_only_once = yes
		days_remove = -1
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				date < 1940.9.1
			}
		}
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			add_timed_idea = { idea = JAP_prioritize_army_aircraft_construction days = 1095 }
			JAP_interservice_rivalry_towards_army = yes
			set_country_flag = JAP_prioritize_army_aircraft_construction
		}
	}
	JAP_prioritize_naval_aircraft_construction = {

		icon = generic_naval

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_prioritize_army_aircraft_construction
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_prioritize_army_aircraft_construction
			}
		}
		cost = 30
		fire_only_once = yes
		days_remove = -1
		ai_will_do = {
			factor = 2
			modifier = {
				factor = 0
				date < 1940.9.1
			}
		}
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			add_timed_idea = {  idea = JAP_prioritize_naval_aircraft_construction days = 1095 }
			JAP_interservice_rivalry_towards_navy = yes
			set_country_flag = JAP_prioritize_naval_aircraft_construction
		}
	}
	JAP_everybody_serves = {

		icon = generic_tank

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_draft_exemptions
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_draft_exemptions
			}
		}
		cost = 30
		fire_only_once = yes
		days_remove = -1
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				date < 1939.1.1
			}
		}
		modifier = {
			conscription = 0.01
            industrial_capacity_factory = 0.05
		}
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			JAP_interservice_rivalry_towards_army = yes
			set_country_flag = JAP_everybody_serves
		}
	}
	JAP_draft_exemptions = {

		icon = generic_naval

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_everybody_serves
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_everybody_serves
			}
		}
		cost = 30
		days_remove = -1
		fire_only_once = yes
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 0
				date < 1939.1.1
			}
		}
		modifier = {
			industrial_capacity_dockyard = 0.1
			conscription_factor = -0.1
		}
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			JAP_interservice_rivalry_towards_navy = yes
			set_country_flag = JAP_draft_exemptions
		}
	}
	JAP_raiding_regiments = {

		icon = generic_tank

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_special_air_landing_force
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_special_air_landing_force
			}
		}
		cost = 30
		fire_only_once = yes
		days_remove = -1
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				date < 1939.1.1
			}
		}
		modifier = {
			special_forces_cap = 0.15
		}
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			set_country_flag = JAP_raiding_regiments
			JAP_interservice_rivalry_towards_army = yes
		}
	}
	JAP_special_air_landing_force = {

		icon = generic_naval

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_country_flag = JAP_raiding_regiments
			}
		}
		visible = {
			NOT = {
				has_country_flag = JAP_raiding_regiments
			}
		}
		cost = 30
		fire_only_once = yes
		days_remove = -1
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				date < 1939.1.1
			}
		}
		modifier = {
			special_forces_attack_factor = 0.1 
			special_forces_defence_factor = 0.05
		}
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			set_country_flag = JAP_special_air_landing_force
			JAP_interservice_rivalry_towards_navy = yes
		}
	}
	JAP_favor_army = {

		icon = generic_tank

		available = {
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			NOT = {
				has_idea = JAP_interservice_rivalry_army_dominant
			}
			AND = {
				OR = { 
					has_country_flag = JAP_raiding_regiments 
					has_country_flag = JAP_special_air_landing_force
				}
				OR = { 
					has_country_flag = JAP_everybody_serves
					has_country_flag = JAP_draft_exemptions
				}
				OR = { 
					has_country_flag = JAP_prioritize_naval_aircraft_construction
					has_country_flag = JAP_prioritize_army_aircraft_construction
				}
				OR = { 
					has_country_flag = JAP_steel_for_guns
					has_country_flag = JAP_steel_for_ships
				}
			}
			
		}
		visible = {

		}
		cost = 100
		days_re_enable = 7
		ai_will_do = {
			factor = 1
		}
		
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			JAP_interservice_rivalry_towards_army = yes
		}
	}
	JAP_favor_navy = {

		icon = generic_naval

		available = { 
			NOT = {
				has_idea = JAP_interservice_rivalry_navy_dominant
			}
			NOT = {
				has_country_flag = JAP_war_conferences_cd
			}
			AND = {
				OR = { 
					has_country_flag = JAP_raiding_regiments 
					has_country_flag = JAP_special_air_landing_force
				}
				OR = { 
					has_country_flag = JAP_everybody_serves
					has_country_flag = JAP_draft_exemptions
				}
				OR = { 
					has_country_flag = JAP_prioritize_naval_aircraft_construction
					has_country_flag = JAP_prioritize_army_aircraft_construction
				}
				OR = { 
					has_country_flag = JAP_steel_for_guns
					has_country_flag = JAP_steel_for_ships
				}
			}
			
		}
		visible = {
		
		}
		cost = 100
		days_re_enable = 7
		ai_will_do = {
			factor = 1
		}
		
		complete_effect = {
			set_country_flag = { flag = JAP_war_conferences_cd value = 1 days = 180 }
			JAP_interservice_rivalry_towards_navy = yes
		}
	}
}

foreign_politics = {
	JAP_sue_for_peace_CHI = {

		allowed = {
			original_tag = JAP
		}

		available = {
			FROM = { 
				surrender_progress < 0.2 # if they are losing, lets not allow it
			}
			custom_trigger_tooltip = {
				tooltip = JAP_sue_for_peace_TT
				NOT = {
					controls_state = 525
					controls_state = 527
				}
				NOT = {
					any_of = {
						array = CHI.core_states
						var:v = {
							NOT = {
								state = 524
							}
							controller = {
								OR = {
									tag = JAP
									AND = {
										is_subject_of = JAP
										OR = {
											tag = MEN
											tag = MAN
										}
									}
								}
							}
						}
					}
				}
				MAN = {
					OR = {
						exists = no
						NOT = {
							is_subject_of = JAP
						}
						has_capitulated = yes
					}
				}
			}
		}

		target_array = enemies

		target_trigger = {
			#Target is FROM
			FROM = {
				tag = event_target:WTT_current_china_leader
				has_war_with = ROOT
			}
		}

		visible = {
			FROM = { 
				exists = yes 
				is_subject = no
			}
			is_subject = no
			any_enemy_country = {
				is_literally_china = yes
			}
		}

		cost = 0

		fire_only_once = yes

		ai_will_do = {
			factor = 400
		}

		complete_effect = {
			event_target:WTT_current_china_leader = {
				country_event = { id = wtt_japan.126 days = 1 }
			}
		}
	}

	JAP_sue_for_peace_MAN = {

		allowed = {
			original_tag = JAP
		}

		available = {
			FROM = { 
				surrender_progress < 0.2 # if they are losing, lets not allow it
			}
			custom_trigger_tooltip = {
				tooltip = JAP_sue_for_peace_TT
				NOT = {
					controls_state = 525
					controls_state = 527
				}
				NOT = {
					any_of = {
						array = CHI.core_states
						var:v = {
							NOT = {
								state = 524
							}
							controller = {
								OR = {
									tag = JAP
									AND = {
										is_subject_of = JAP
										tag = MEN
									}
								}
							}
						}
					}
				}
			}
		}


		target_trigger = {
			#Target is FROM
			FROM = {
				tag = MAN
				has_war_with = ROOT
			}
		}

		visible = {
			FROM = { 
				exists = yes 
				is_subject = no
			}
			is_subject = no
			has_war_with = FROM
		}

		cost = 0

		fire_only_once = yes

		ai_will_do = {
			base = 400
			modifier = {
				factor = 0
				casualties_inflicted_by = {
					opponent = MAN
					thousands < 300
				}
			}

			modifier = {
				factor = 0
				NOT = {has_country_flag = JAP_dont_surrender_instantly_lock}
			}
		}

		complete_effect = {
			MAN = {
				country_event = { id = wtt_japan.129 days = 1 }
			}
		}
	}

	JAP_sue_for_peace_nuke = {

		allowed = {
			original_tag = JAP
		}

		available = {
			has_global_flag = JAP_nuke_1
			has_global_flag = JAP_nuke_2
			has_navy_size = { size < 80 }
			OR = { 
			NOT = { controls_state = 526 }
			NOT = { controls_state = 645 }
			}
		}

		visible = {
			has_war = yes
			has_global_flag = JAP_nuke_1
		}

		cost = 5

		days_remove = 365
		ai_will_do = {
			factor = 150
		}

		modifier = {
			forced_surrender_limit = -0.99
		}

		remove_effect = {
			add_war_support = 0.1
			add_stability = 0.1
		}

		remove_trigger = {
			has_war = no
		}
		complete_effect = {
			hidden_effect = {
				clr_global_flag = JAP_nuke_1
				clr_global_flag = JAP_nuke_2
			}
		}
	}
	JAP_sue_for_peace_nuke_mission = {
		available = {
			has_global_flag = JAP_nuke_1
			has_global_flag = JAP_nuke_2
		}

		visible = {

		}

		modifier = {
			
		}
		is_good = no
		
		days_mission_timeout = 730
		fire_only_once = yes

		activation = {
			has_tech = nukes
			has_war_with = JAP
		}

		complete_effect = {
			JAP = {
				unlock_decision_tooltip = JAP_sue_for_peace_nuke
				add_war_support = -0.25
				add_stability = -0.25
			}
		}
	}

	JAP_request_soviet_support = {

		icon = generic_prepare_civil_war

		available = {
			SOV = { has_government = communism }
		}

		visible = {
			tag = JAP
			has_civil_war = yes
			has_government = communism
			
		}

		cost = 50
		fire_only_once = yes
		ai_will_do = {
			factor = 10
		}

		complete_effect = {
			SOV = { country_event = { id = wtt_japan.118 } }
		}
	}
}

#Category allowed for JAP
#Not visible if puppet
JAP_southern_expansion = {

	JAP_pressure_france = { 

		available = {
			16 = { NOT = { is_controlled_by = FRA } } #Paris has fallen
			286 = { 
				CONTROLLER = { 
					NOT = {
						has_war_with = ROOT
						is_in_faction_with = ROOT
					}
				} 
			}
			670 = { 
				CONTROLLER = { 
					NOT = {
						has_war_with = ROOT
						is_in_faction_with = ROOT
					}
				} 
			}
			671 = { 
				CONTROLLER = { 
					NOT = {
						has_war_with = ROOT
						is_in_faction_with = ROOT
					}
				} 
			}
			custom_trigger_tooltip = {
				tooltip = demand_indochina_focus_tt
				OR = {
					286 = { 
						CONTROLLER = { 
							OR = { 
								tag = FRA 
								tag = VIC
								is_subject_of = FRA
								is_subject_of = VIC 
							} 
						}
					}
					670 = { 
						CONTROLLER = { 
							OR = { 
								tag = FRA 
								tag = VIC 
								is_subject_of = FRA
								is_subject_of = VIC
							} 
						}
					}
					671 = { 
						CONTROLLER = { 
							OR = { 
								tag = FRA 
								tag = VIC 
								is_subject_of = FRA
								is_subject_of = VIC
							} 
						}
					}
				}
			}
		}

		visible = {
			has_completed_focus = JAP_strike_south_doctrine
		}

		fire_only_once = yes


		modifier = {

		}

		cost = 75

		ai_will_do = {
			factor = 5
			modifier = {
				factor = 0
				FRA = { has_war = no }
			}			
			modifier = {
				factor = 3
				FRA = { has_war = yes } 
				strength_ratio = {
					tag = FRA
					ratio > 0.9
				}
			}
			
		}

		complete_effect = {
			if = {
				limit = {
					FRA = {
						OR = {
							controls_state = 671
							671 = { CONTROLLER = { is_subject_of = FRA } }
							controls_state = 670
							670 = { CONTROLLER = { is_subject_of = FRA } }
							controls_state = 286
							286 = { CONTROLLER = { is_subject_of = FRA } }
						}
					}
				}
				FRA = { country_event = { id = france.1 } }
			}
			else_if = {
				limit = {
					VIC = {
						OR = {
							controls_state = 671
							controls_state = 670
							controls_state = 286
							671 = { CONTROLLER = { is_subject_of = VIC } }
							670 = { CONTROLLER = { is_subject_of = VIC } }
							286 = { CONTROLLER = { is_subject_of = VIC } }
						}
					}
				}
				VIC = { country_event = { id = france.1 } }
			}
		}

	}
}

#Category allowed for JAP
#Visible when has completed JAP_pacific_guardian focus.
#Visible if independent
JAP_pacific_guardian = {

	JAP_release_korea = {

		icon = generic_independence

		available = { country_exists = KOR }

		days_mission_timeout = 180

		fire_only_once = yes
		is_good = no 
		activation = {
			has_completed_focus = JAP_the_korean_question
			has_full_control_of_state = 525
			has_full_control_of_state = 527
			KOR = { exists = no }
		}

		complete_effect = {
			add_political_power = 50
		}
		timeout_effect = {
			add_stability = -0.05 #naughty
		}
	}

	JAP_guardian_of_INS = {

		icon = jap_pacific_guardian

		available = {
			HOL = {
				#has_capitulated = yes
				NOT =  { has_war_with = ROOT}
			}
			"INS" = {
				is_puppet_of = HOL
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 50

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			HOL = { country_event = { id = wtt_japan.1 } }
		}
	}

	JAP_guardian_of_MAL = {

		icon = jap_pacific_guardian

		available = {
			ENG = {
				#has_capitulated = yes
				NOT =  { has_war_with = ROOT}
			}
			MAL = {
				is_puppet_of = ENG
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 50

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			ENG = { country_event = { id = wtt_japan.1 } }
		}
	}

	JAP_guardian_of_indochina = {

		icon = jap_pacific_guardian

		available = {
			FRA = {
				#has_capitulated = yes
				NOT =  { has_war_with = ROOT}
				OR = {
					has_full_control_of_state = 670
					has_full_control_of_state = 671
					has_full_control_of_state = 286
					has_full_control_of_state = 741
				}
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 50

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			FRA = { country_event = { id = wtt_japan.1 } }
		}
	}
}

JAP_colonial_independence = {
	JAP_return_manchuria = {

		icon = generic_independence

		allowed = {
			original_tag = JAP
		}

		available = {
			609 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			610 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			716 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			715 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			328 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			717 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			714 = {
				is_fully_controlled_by = controller
				CONTROLLER = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
		}

		visible = {
			has_completed_focus = JAP_liberate_manchuria
			609 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			610 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			716 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			715 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			328 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			717 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
			714 = {
				owner = {
					OR = {
						is_puppet_of = JAP
						original_tag = JAP
					}
				}
			}
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 0

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			if = {
				limit = {
					country_exists = event_target:WTT_current_china_leader
				}
				event_target:WTT_current_china_leader = { 
					transfer_state = 609
					transfer_state = 610
					transfer_state = 716
					transfer_state = 715
					transfer_state = 328
					transfer_state = 717
					transfer_state = 714
					transfer_state = 761
					transfer_state = 745
					transfer_state = 612
					transfer_state = 611
					country_event = { id = wtt_japan.101 days = 1 }
					custom_effect_tooltip = JAP_liberate_manchuria_alliance_tt
				}
			}
			if = {
				limit = {
					country_exists = event_target:WTT_communist_china
					NOT = { country_exists = event_target:WTT_current_china_leader }
				}
				event_target:WTT_communist_china = { 
					transfer_state = 609
					transfer_state = 610
					transfer_state = 716
					transfer_state = 715
					transfer_state = 328
					transfer_state = 717
					transfer_state = 714
					transfer_state = 761
					transfer_state = 745
					transfer_state = 612
					transfer_state = 611
					country_event = { id = wtt_japan.101 days = 1 }
				}
			}
			if = {
				limit = {
					NOT = { country_exists = event_target:WTT_communist_china }
					NOT = { country_exists = event_target:WTT_current_china_leader }
				}
				random_other_country = {
					limit = {
						OR = {
							original_tag = GXC
							original_tag = YUN
							original_tag = XSM
							original_tag = SIK
							original_tag = SHX
							original_tag = MEN
						}
						NOT = {
							has_government = communism
							has_government = fascism
						}
					}
					transfer_state = 609
					transfer_state = 610
					transfer_state = 716
					transfer_state = 715
					transfer_state = 328
					transfer_state = 717
					transfer_state = 714
					transfer_state = 761
					transfer_state = 745
					transfer_state = 612
					transfer_state = 611
					country_event = { id = wtt_japan.101 days = 1 }
					custom_effect_tooltip = JAP_liberate_manchuria_alliance_tt
				}
			}
		}
	}
}

political_actions = {
	JAP_break_the_london_naval_treaty = {

		icon = generic_break_treaty

		allowed = {
			original_tag = JAP
		}

		available = {

		}

		visible = {
			has_idea = JAP_the_london_naval_treaty
			has_completed_focus = JAP_join_the_london_naval_treaty
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 25

		ai_will_do = {
			factor = 0
		}

		complete_effect = {
			remove_ideas = JAP_the_london_naval_treaty
			FRA = { add_opinion_modifier = { target = ROOT modifier = JAP_broke_the_london_naval_treaty } }
			USA = { add_opinion_modifier = { target = ROOT modifier = JAP_broke_the_london_naval_treaty } }
			ENG = { add_opinion_modifier = { target = ROOT modifier = JAP_broke_the_london_naval_treaty } }
			FRA = { remove_opinion_modifier = { target = ROOT modifier = JAP_join_the_london_naval_treaty } }
			USA = { remove_opinion_modifier = { target = ROOT modifier = JAP_join_the_london_naval_treaty } }
			ENG = { remove_opinion_modifier = { target = ROOT modifier = JAP_join_the_london_naval_treaty } }
			remove_opinion_modifier = { target = FRA modifier = JAP_join_the_london_naval_treaty }
			remove_opinion_modifier = { target = USA modifier = JAP_join_the_london_naval_treaty }
			remove_opinion_modifier = { target = ENG modifier = JAP_join_the_london_naval_treaty }
		}		
	}
}

operations = {
	
	JAP_tora_tora_tora = {
		
		allowed = {
			original_tag = JAP
		}

		icon = decision_generic_naval

		available = {
			OR = {
				has_war_with = HOL
				has_war_with = ENG
				has_war_with = USA
				has_war_with = FRA
			}
		}

		is_good = no
	
		fire_only_once = yes
	
		days_mission_timeout = 180
	
		activation = {
			has_completed_focus = JAP_strike_on_the_southern_resource_area
		}
		
		visible = {
			has_completed_focus = JAP_strike_on_the_southern_resource_area
		}
	
		complete_effect = {
			add_timed_idea = { idea = JAP_tora_tora_tora_idea days = 180 }
		}
	}


	#first border incident
	JAP_test_the_soviets = {
		icon = border_war
		allowed = {
			original_tag = JAP
		}

		available = {
			OR = { has_completed_focus = JAP_purge_the_kodoha_faction has_completed_focus = JAP_support_the_kodoha_faction }
			NOT = { has_war_with = SOV is_in_faction_with = SOV has_non_aggression_pact_with = SOV }
			SOV = { is_subject = no }
			SOV = { surrender_progress < 0.15 }
			527 = { any_neighbor_state = { is_controlled_by = SOV } }
			date > 1937.1.1
		}

		visible = {
			NOT = { has_global_flag = JAP_kalkin_gol }
		}


		highlight_states = {
	 		highlight_state_targets = {
				state = 408
				state = 527
			} 
		}
		
		fire_only_once = yes
		ai_will_do = {
			factor = 150
			modifier = {
				date > 1940.1.1
				factor = 0
			}
			modifier = {
				date < 1938.1.1
				factor = 0
			}
			modifier = { # We won't do this if we are supporting the opposition
				OR = {
					SOV = { has_country_flag = SOV_CSW_transfer_vladivostok_flag }
					SOV = { has_country_flag = SOV_CSW_transfer_sakhalin_flag }
				}
				factor = 0
			}
		}
		cost = 5
		days_remove = 50
		war_with_on_remove = SOV
		complete_effect = {
			527 = {
				save_event_target_as = JAP_SOV_attacker_state
				set_state_flag = border_incident_active
			}
			408 = {
				save_event_target_as = JAP_SOV_defender_state
				set_state_flag = border_incident_active
			}
			SOV = {
				country_event = { id = japan_border_conflict.1 days = 1 }
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_warning_SOV }
			}
		}
		remove_effect = {
			activate_targeted_decision = { target = SOV decision = JAP_border_incident_forgotten }
			activate_targeted_decision = { target = SOV decision = JAP_escalate_incident_to_border_conflict_SOV }
		}
	}

	#Mission for defender warning that a conflict with FROM is coming
	JAP_border_conflict_warning_SOV = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			hidden_trigger = { always = no }
		}

		war_with_target_on_timeout = yes
		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 50

		fire_only_once = yes

		is_good = no
		
		timeout_effect = {
			custom_effect_tooltip = escalation_possible_tooltip_for_defender
			custom_effect_tooltip = effects_if_border_conflict_is_lost
			effect_tooltip = {
				JAP = {
					add_doctrine_cost_reduction = {
						name = sov_jap_border_conflict_won
						category = land_doctrine
						cost_reduction = 0.5
					}
					add_tech_bonus = {
						name = sov_jap_border_conflict_won
						category = armor
						bonus = 0.5
					}
				}
			}
			hidden_effect = {
				remove_targeted_decision = { target = JAP decision = JAP_border_conflict_warning_SOV }
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalation_warning_SOV }
			}
		}
	}

	#Mission for defender warning FROM can escalate to war at any point is coming
	JAP_border_conflict_escalation_warning_SOV = {

		icon = border_war

		allowed = { always = no } #Activated from effect
		visible = { hidden_trigger = { NOT = { has_border_war_with = JAP } } }
		cancel_if_not_visible = yes 

		available = {
			#var:ROOT.defender_state_vs_@FROM = {
			#	has_ROOT_at_least_1_div_in_current_state_scope = yes
			#}
			hidden_trigger = { always = no }
		}

		war_with_target_on_timeout = yes
		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 50

		fire_only_once = yes

		is_good = no

		timeout_effect = {
			custom_effect_tooltip = from_cannot_escalate
			custom_effect_tooltip = effects_if_border_conflict_is_lost
			effect_tooltip = {
				JAP = {
		     army_experience = 50
		     air_experience = 25
					add_doctrine_cost_reduction = {
						name = sov_jap_border_conflict_won
						category = land_doctrine
						cost_reduction = 0.5
					}
					add_tech_bonus = {
						name = sov_jap_border_conflict_won
						category = armor
						bonus = 0.5
					}
				}
			}
		}		
	}
	#Mission for attacker to escalate or incident is forgotten
	JAP_border_incident_forgotten = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			has_border_war_with = SOV # Japan shouldn't lose war support if they actually use the window of opportunity
		}

		highlight_states = {
			highlight_state_targets = {
				state = 527
				state = 408
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		days_mission_timeout = 50

		fire_only_once = yes

		is_good = no
		
		timeout_effect = {
			remove_targeted_decision = { target = SOV decision = JAP_escalate_incident_to_border_conflict_SOV }
			add_war_support = -0.1
			hidden_effect = {
				SOV = { remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalation_warning_SOV } }
				SOV = {
					527 = {
						clr_state_flag = border_incident_active
					}
					408 = {
						clr_state_flag = border_incident_active
					}
				}
			}
		}
	}

	#Decision to escalate incident on border with SOV to border conflict
	JAP_escalate_incident_to_border_conflict_SOV = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			527 = {
				OR = {
					is_fully_controlled_by = ROOT
					CONTROLLER = {
						is_subject_of = ROOT
					}
					CONTROLLER = {
						is_in_faction_with = ROOT
					}
				}
			}
			divisions_in_border_state = {
				state = 527
				border_state = 408
				size > 2
			}
		}
		
		cost = 5

		highlight_states = {
			highlight_state_targets = {
				state = 527
				state = 408	
			} 
		}

		ai_will_do = {
			base = 100
			modifier = { 
				has_war = no
				factor = 100
			}
		}

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {
			remove_targeted_decision = { target = SOV decision = JAP_border_incident_forgotten }
			start_border_war = {
				change_state_after_war = no
				attacker = {
					state = 527
					num_provinces = 5
					on_win = japan_border_conflict.2
					on_lose = japan_border_conflict.3
					on_cancel = japan_border_conflict.4
				}
				
				defender = {
					state = 408
					num_provinces = 5
					on_win = japan_border_conflict.3
					on_lose = japan_border_conflict.2
					on_cancel = japan_border_conflict.4
				}
			}
			SOV = {
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_conflict }
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_time_until_cancelled }
			}
			activate_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_conflict }
			activate_targeted_decision = { target = SOV decision = JAP_border_conflict_time_until_cancelled }
		}
	}
	#Mission for attacker to win border war against FROM in X days
	JAP_border_conflict_time_until_cancelled = {

		icon = border_war

		allowed = { always = no } #Activated from effect

		available = {
			527 = { has_border_war = no }
			408 = { has_border_war = no }
		}
		
		highlight_states = {
			highlight_state_targets = {
				state = 408
				state = 527
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
			}
		}

		days_mission_timeout = 90
		is_good = no

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {

		}

		timeout_effect = {
			cancel_border_war = {
				defender = 408
				attacker = 527
			}
			hidden_effect = {
				remove_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_conflict }
				remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_conflict }
			}
		}
	}

	#Decision to escalate conflict further
	JAP_border_conflict_escalate_conflict = {

		icon = generic_ignite_civil_war

		allowed = { always = no } #Activated from effect

		visible = {
			has_border_war_with = FROM
		}

		highlight_states = {
			highlight_state_targets = {
				state = 527
				state = 408
			} 
		}

		cost = 100

		ai_will_do = {
			base = 0
			modifier = {
				add = 100 
				is_historical_focus_on = no 
			}
			modifier = {
				add = 50 
				AND = {
					tag = JAP 
					has_completed_focus = JAP_support_the_kodoha_faction
				}
			}
			modifier = {
				factor = 0
				has_war = yes 
			}
		}

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {
			if = {
				limit = { original_tag = SOV }
				set_border_war_data = {
					attacker = 527
					defender = 408
					defender_modifier = 0.1
					combat_width = 120
				}
				JAP = {
					set_country_flag = {
						flag = WTT_border_conflict_escalate_to_war_cooldown
						days = 70
						value = 1
					}
					remove_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_conflict }
				}
				set_country_flag = {
					flag = WTT_border_conflict_escalate_to_war_cooldown
					days = 70
					value = 1
				}
				custom_effect_tooltip = in_60_days
				activate_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_to_war }
			}
			else = {
				set_border_war_data = {
					attacker = 527
					defender = 408
					attacker_modifier = 0.1
					combat_width = 120
				}
				SOV = {
					set_country_flag = {
						flag = WTT_border_conflict_escalate_to_war_cooldown
						days = 70
						value = 1
					}
					remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_conflict }
				}
				set_country_flag = {
					flag = WTT_border_conflict_escalate_to_war_cooldown
					days = 70
					value = 1
				}
				custom_effect_tooltip = in_60_days
				activate_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_to_war }
			}
			
		}
	}

	#Decision to escalate conflict further
	JAP_border_conflict_escalate_to_war = {

		icon = generic_ignite_civil_war

		allowed = { always = no } #Activated from effect

		visible = {
			NOT = { has_country_flag = WTT_border_conflict_escalate_to_war_cooldown }
			has_border_war_with = FROM
		}
		cancel_trigger = {
			NOT = { has_border_war = yes }
		}

		highlight_states = {
 			highlight_state_targets = {
				state = 408
				state = 527
			} 
		}

		cost = 50

		ai_will_do = {
			base = 0
			modifier = {
				add = 100 
				is_historical_focus_on = no 
			}
			modifier = {
				add = 50 
				AND = {
					tag = JAP 
					has_completed_focus = JAP_support_the_kodoha_faction
				}
			}
			modifier = {
				factor = 0
				has_war = yes 
			}
		}

		days_remove = 15

		fire_only_once = yes #Reactivation handled in effect

		war_with_target_on_remove = yes

		complete_effect = {
			if = {
				limit = { original_tag = SOV }
				408 = { save_event_target_as = their_state }
				527 = { save_event_target_as = our_state }
				JAP = {
					country_event = { id = japan_border_conflict.6 hours = 1 }
					hidden_effect = {
						remove_targeted_decision = { target = SOV decision = JAP_border_conflict_escalate_to_war }
					}
			 	}
			}
			else = {
				527 = { save_event_target_as = our_state }
				408 = { save_event_target_as = their_state }
				SOV = {
					country_event = { id = japan_border_conflict.5 hours = 1 }
					hidden_effect = {
						remove_targeted_decision = { target = JAP decision = JAP_border_conflict_escalate_to_war }
					}
			 	}
			}
			
		}

		remove_effect = {
			cancel_border_war = {
				dont_fire_events = yes
				defender = 408
				attacker = 527
			}
			declare_war_on = { target = FROM type = annex_everything }
			if = {
				limit = { original_tag = SOV }
				527 = {
					clr_state_flag = border_incident_active
				}
				408 = {
					clr_state_flag = border_incident_active
				}
				
			}
			else = {
				FROM = {
					527 = {
						clr_state_flag = border_incident_active
					}
					408 = {
						clr_state_flag = border_incident_active
					}
				}
			}
		}
	}

	#Decision to back down from conflict
	JAP_border_conflict_back_out_of_conflict = {

		allowed = { always = no } #Activated from effect

		visible = {
			has_border_war_with = FROM
		}

		highlight_states = {
			highlight_state_targets = {
				state = 527
				state = 408
			} 
		}

		ai_will_do = {
			base = 0
			modifier = {
				
			}
		}

		fire_only_once = yes #Reactivation handled in effect

		complete_effect = {
			if = {
				limit = { original_tag = SOV }
				finalize_border_war = {
					attacker_win = yes
					attacker = 527
					defender = 408
				}
			}
			else = {
				finalize_border_war = {
					attacker = 527
					defender = 408
					defender_win = yes
				}
			}
		}
	}

	JAP_war_with_soviet_union = {

		icon = generic_ignite_civil_war

		allowed = {
			original_tag = JAP
		}

		available = {
			GER = { NOT = { has_war_with = SOV } }
			NOT = { has_war_with = SOV }
			has_completed_focus = JAP_preemptive_war
			SOV = {  surrender_progress < 0.1 }
		}

		visible = {
			has_completed_focus = JAP_preemptive_war
		}

		fire_only_once = yes


		modifier = {

		}

		days_remove = 0
		days_re_enable = 0

		cost = 100

		ai_will_do = {
			factor = 0
		}

		complete_effect = {
			declare_war_on = { target = SOV type = annex_everything }
			GER = { country_event = { id = wtt_japan.115 hours = 6 } }
		}		
	}
}

prospect_for_resources = {

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

	#Below is visible when JAP_establish_the_northern_resource_area is completed
	JAP_develop_north_sakhalin_oil_deposits = { #655
		icon = oil

		highlight_states = {
 highlight_state_targets = {
			state = 655
		} 
}

		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 655
			has_tech = excavation2
		}

		visible = {
			has_completed_focus = JAP_establish_the_northern_resource_area
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 10
		}

		complete_effect = {
			655 = {
				add_resource = {
					type = oil
					amount = 8
				}
			}
		}
	}


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

#623:0 "Luzon"
#627:0 "Mindanao"
#625:0 "Samar"
#725:0 "Nauru"

	#Below is visible when JAP_exploit_the_southern_resource_area is completed
	JAP_develop_luzon_chromium_deposits = { #623
		icon = chromium

		highlight_states = {
 highlight_state_targets = {
			state = 623
		} 
}

		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 623
			has_tech = excavation3
		}

		visible = {
			has_completed_focus = JAP_exploit_the_southern_resource_area
			623 = {
				NOT = {
					has_state_flag = luzon_chromium_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 10
		}

		complete_effect = {
			623 = {
				add_resource = {
					type = chromium
					amount = 12
				}
				set_state_flag = luzon_chromium_developed
			}
		}
	}

	JAP_develop_mindanao_steel_deposits = { #627
		icon = steel

		highlight_states = {
 highlight_state_targets = {
			state = 627
		} 
}

		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 627
			has_tech = excavation4
		}

		visible = {
			has_completed_focus = JAP_exploit_the_southern_resource_area
			627 = {
				NOT = {
					has_state_flag = mindanao_steel_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 10
		}

		complete_effect = {
			627 = {
				add_resource = {
					type = steel
					amount = 8
				}
				set_state_flag = mindanao_steel_developed
			}
		}
	}

	JAP_develop_samar_steel_deposits = { #625
		icon = steel

		highlight_states = {
 highlight_state_targets = {
			state = 625
		} 
}

		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 625
			has_tech = excavation3
		}

		visible = {
			has_completed_focus = JAP_exploit_the_southern_resource_area
			625 = {
				NOT = {
					has_state_flag = samar_steel_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 10
		}

		complete_effect = {
			625 = {
				add_resource = {
					type = steel
					amount = 6
				}
				set_state_flag = samar_steel_developed
			}
		}
	}

	JAP_develop_nauru_tungsten_deposits = { #725
		icon = tungsten

		allowed = {
			original_tag = JAP
		}

		highlight_states = {
 highlight_state_targets = {
			state = 725
		} 
}

		available = {
			has_full_control_of_state = 725
			has_tech = excavation4
		}

		visible = {
			has_completed_focus = JAP_exploit_the_southern_resource_area
			725 = {
				NOT = {
					has_state_flag = nauru_tungsten_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			725 = {
				add_resource = {
					type = tungsten
					amount = 4
				}
				set_state_flag = nauru_tungsten_developed
			}
		}
	}
	JAP_develop_tonkin_aluminium_deposits = { #671
		icon = aluminium
		
		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 671
			has_tech = excavation4
		}

		visible = {
			has_completed_focus = JAP_exploit_the_southern_resource_area
			671 = {
				NOT = {
					has_state_flag = tonkin_aluminium_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			671 = {
				add_resource = {
					type = aluminium
					amount = 6
				}
				set_state_flag = tonkin_aluminium_developed
			}
		}
	}
	JAP_develop_singapore_aluminium_deposits = { #336
		icon = aluminium
		
		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 336
			has_tech = excavation2
		}

		visible = {
			has_completed_focus = JAP_exploit_the_southern_resource_area
			336 = {
				NOT = {
					has_state_flag = singapore_aluminium_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			336 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = singapore_aluminium_developed
			}
		}
	}

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

#597:0 "Shandong"
#621:0 "Suiyuan"

	#Below is visible when JAP_develop_chinese_resources is completed
	JAP_develop_shandong_aluminium_deposits = { #597
		
		icon = aluminium

		highlight_states = {
 highlight_state_targets = {
			state = 597
		} 
}

		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 597
			has_tech = excavation3
		}

		visible = {
			has_completed_focus = JAP_develop_chinese_resources
			597 = {
				NOT = {
					has_state_flag = shandong_aluminium_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			597 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = shandong_aluminium_developed
			}
		}
	}

	JAP_develop_suiyuan_steel_deposits = { #621
		
		icon = steel

		highlight_states = {
 highlight_state_targets = {
			state = 621
		} 
}

		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 621
			has_tech = excavation2
		}

		visible = {
			has_completed_focus = JAP_develop_chinese_resources
			621 = {
				NOT = {
					has_state_flag = suiyuan_steel_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 10
		}

		complete_effect = {
			621 = {
				add_resource = {
					type = steel
					amount = 8
				}
				set_state_flag = suiyuan_steel_developed
			}
		}	
	}

	JAP_develop_yunnan_aluminium_deposits = { #325

		icon = aluminium
		
		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 325
			has_tech = excavation3
		}

		visible = {
			has_completed_focus = JAP_develop_chinese_resources
			325 = {
				NOT = {
					has_state_flag = yunnan_aluminium_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			325 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = yunnan_aluminium_developed
			}
		}	
	}
	JAP_develop_sichuan_aluminium_deposits = { #605

		icon = aluminium
		
		allowed = {
			original_tag = JAP
		}

		available = {
			has_full_control_of_state = 605
			has_tech = excavation3
		}

		visible = {
			has_completed_focus = JAP_develop_chinese_resources
			605 = {
				NOT = {
					has_state_flag = sichuan_aluminium_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			605 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
				set_state_flag = sichuan_aluminium_developed
			}
		}	
	}

}
