@MAN_HUNT_BANDITS_EQUIPMENT_COST_TRIGGER = 499
@MAN_HUNT_BANDITS_EQUIPMENT_COST_EFFECT = -500

MAN_banditry_category = {

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

	MAN_pacify_bandits_in_the_northern_countryside = {

		icon = generic_oppression
		
		available = {
			has_completed_focus = MAN_pacify_the_countryside
			has_country_flag = MAN_northern_bandits
			divisions_in_state = {
				state = 714	
				size > 5
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 714
		} 
}

		cost = 0

		ai_will_do = {
			factor = 0
			modifier = {
				add = 200
				divisions_in_state = {
					state = 714	
					size > 5
				}
			}
		}

		visible = {
			NOT = { has_active_mission = MAN_maintain_northern_control }
			has_country_flag = MAN_northern_bandits
		}

		is_good = yes

		complete_effect = {
			activate_mission = MAN_maintain_northern_control
			custom_effect_tooltip = MAN_pacify_bandits_mission_explanation
		}
	}

	MAN_hunt_down_northern_bandits = {

		icon = generic_oppression

		available = {
			has_completed_focus = MAN_pacify_the_countryside
			has_equipment = { infantry_equipment > @MAN_HUNT_BANDITS_EQUIPMENT_COST_TRIGGER }
			has_country_flag = MAN_northern_bandits
		}

		cost = 0

		highlight_states = {
 highlight_state_targets = {
			state = 714
		} 
}
		visible = {
			has_country_flag = MAN_northern_bandits
		}
		is_good = yes

		fire_only_once = yes

		ai_will_do = {
			factor = 0
			modifier = {
				add = 200
				divisions_in_state = {
					state = 714	
					size < 6
				}
			}
		}

		complete_effect = {
			custom_effect_tooltip = MAN_hunt_down_northern_bandits_tt
			add_manpower = -1000
			
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @MAN_HUNT_BANDITS_EQUIPMENT_COST_EFFECT
			}

			army_experience = 10

			remove_mission = MAN_maintain_northern_control
			clr_country_flag = MAN_northern_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_eastern_bandits }
					NOT = { has_country_flag = MAN_western_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}

	MAN_maintain_northern_control = {

		icon = generic_civil_support

		available = {
			always = no
		}

		days_mission_timeout = MAN_main_control_timer?180

		activation = {
			always = no #Triggered from effect
		}

		cancel_trigger = {
			divisions_in_state = {
				state = 714	
				size < 6
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 714
		} 
}

		visible = {
			
		}

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = MAN_hunt_down_northern_bandits_tt
			army_experience = 10
			clr_country_flag = MAN_northern_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_eastern_bandits }
					NOT = { has_country_flag = MAN_western_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}

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

	MAN_pacify_bandits_in_the_eastern_countryside = {

		icon = generic_oppression
		
		available = {
			has_completed_focus = MAN_pacify_the_countryside
			has_country_flag = MAN_eastern_bandits
			divisions_in_state = {
				state = 1417
				size > 5
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 1417
		} 
}

		cost = 0

		ai_will_do = {
			factor = 0
			modifier = {
				add = 200
				divisions_in_state = {
					state = 1417	
					size > 5
				}
			}
		}

		visible = {
			NOT = { has_active_mission = MAN_maintain_eastern_control }
			has_country_flag = MAN_eastern_bandits
		}

		is_good = yes

		complete_effect = {
			activate_mission = MAN_maintain_eastern_control
			custom_effect_tooltip = MAN_pacify_bandits_mission_explanation
		}
	}

	MAN_hunt_down_eastern_bandits = {

		icon = generic_oppression

		available = {
			has_completed_focus = MAN_pacify_the_countryside
			has_equipment = { infantry_equipment > @MAN_HUNT_BANDITS_EQUIPMENT_COST_TRIGGER }
			has_country_flag = MAN_eastern_bandits
		}

		visible = {
			has_country_flag = MAN_eastern_bandits
		}

		cost = 0

		highlight_states = {
 highlight_state_targets = {
			state = 1417
		} 
}

		is_good = yes

		fire_only_once = yes

		ai_will_do = {
			factor = 0
			modifier = {
				add = 200
				divisions_in_state = {
					state = 1417	
					size < 6
				}
			}
		}

		complete_effect = {
			custom_effect_tooltip = MAN_hunt_down_eastern_bandits_tt
			add_manpower = -1000
			
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @MAN_HUNT_BANDITS_EQUIPMENT_COST_EFFECT
			}

			army_experience = 10

			remove_mission = MAN_maintain_eastern_control
			clr_country_flag = MAN_eastern_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_northern_bandits }
					NOT = { has_country_flag = MAN_western_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}

	MAN_maintain_eastern_control = {

		icon = generic_civil_support

		available = {			
			always = no
		}

		days_mission_timeout = MAN_main_control_timer?180

		activation = {
			always = no #Triggered from effect
		}

		cancel_trigger = {
			divisions_in_state = {
				state = 1417	
				size < 6
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 1417
		} 
}

		visible = {
			
		}

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = MAN_hunt_down_eastern_bandits_tt
			army_experience = 10
			clr_country_flag = MAN_eastern_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_northern_bandits }
					NOT = { has_country_flag = MAN_western_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}

#   # ###  ## ### ### ###  #  # 
#   # #   #    #  #   #  # ## # 
# # # ##   #   #  ##  ###  # ## 
# # # #     #  #  #   #  # #  # 
 # #  ### ##   #  ### #  # #  # 
	
	MAN_pacify_bandits_in_the_western_countryside = {

		icon = generic_oppression
		
		available = {
			has_completed_focus = MAN_pacify_the_countryside
			has_country_flag = MAN_western_bandits
			divisions_in_state = {
				state = 610	
				size > 5
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 610
		} 
}

		cost = 0

		ai_will_do = {
			factor = 0
			modifier = {
				add = 200
				divisions_in_state = {
					state = 610	
					size > 5
				}
			}
		}

		visible = {
			NOT = { has_active_mission = MAN_maintain_western_control }
			has_country_flag = MAN_western_bandits
		}

		is_good = yes

		complete_effect = {
			activate_mission = MAN_maintain_western_control
			custom_effect_tooltip = MAN_pacify_bandits_mission_explanation
		}
	}

	MAN_hunt_down_western_bandits = {

		icon = generic_oppression

		available = {
			has_completed_focus = MAN_pacify_the_countryside
			has_equipment = { infantry_equipment > @MAN_HUNT_BANDITS_EQUIPMENT_COST_TRIGGER }
			has_country_flag = MAN_western_bandits
		}

		cost = 0

		highlight_states = {
 highlight_state_targets = {
			state = 610
		} 
}

		visible = {
			has_country_flag = MAN_western_bandits
		}

		is_good = yes

		fire_only_once = yes

		ai_will_do = {
			factor = 0
			modifier = {
				add = 200
				divisions_in_state = {
					state = 610	
					size < 6
				}
			}
		}

		complete_effect = {
			custom_effect_tooltip = MAN_hunt_down_western_bandits_tt
			add_manpower = -1000
			
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = @MAN_HUNT_BANDITS_EQUIPMENT_COST_EFFECT
			}

			army_experience = 10

			remove_mission = MAN_maintain_western_control
			clr_country_flag = MAN_western_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_eastern_bandits }
					NOT = { has_country_flag = MAN_northern_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}

	MAN_maintain_western_control = {

		icon = generic_civil_support

		available = {			
			always = no
		}

		days_mission_timeout = MAN_main_control_timer?180

		activation = {
			always = no #Triggered from effect
		}

		cancel_trigger = {
			divisions_in_state = {
				state = 610	
				size < 6
			}
		}

		highlight_states = {
 highlight_state_targets = {
			state = 610
		} 
}

		visible = {
			
		}

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = MAN_hunt_down_western_bandits_tt
			army_experience = 10
			clr_country_flag = MAN_western_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_eastern_bandits }
					NOT = { has_country_flag = MAN_northern_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}

	MAN_bandit_raids = {

		icon = generic_civil_support

		available = {
			NOT = { has_idea = MAN_banditry }
		}

		days_mission_timeout = 180

		activation = {
			has_idea = MAN_banditry
		}

		visible = {
			
		}		

		fixed_random_seed = no

		fire_only_once = no

		is_good = no

		timeout_effect = {
			random_list = {
				25 = {
					country_event = wtt_manchukou_bandit_sabotage.21
				}
				25 = {
					country_event = wtt_manchukou_bandit_sabotage.22
				}
				25 = {
					country_event = wtt_manchukou_bandit_sabotage.23
				}
				25 = {
					
				}
			}
		}
	}
	MAN_recruit_bandits_north = {
		icon = generic_civil_support

		available = {
			has_country_flag = MAN_northern_bandits
			has_completed_focus = MAN_bolster_nationalism
		}
		visible = {
			has_country_flag = MAN_northern_bandits
		}
		ai_will_do = {
			factor = 10
		}
		cost = 50
		complete_effect = {
			if = {
				limit = {
					not = {
						has_country_flag = MAN_bandits_recruited
					}
				}
				division_template = {
					name = "Redemption Army"
					priority = 1
					is_locked = yes
					division_names_group = MAN_CAV_01
					regiments = {
						cavalry = { x = 0 y = 0 }
						cavalry = { x = 0 y = 1 }
						cavalry = { x = 0 y = 2 }

						cavalry = { x = 1 y = 0 }
						cavalry = { x = 1 y = 1 }
						cavalry = { x = 1 y = 2 }
					}
				}
				set_country_flag = MAN_bandits_recruited
			}
			random_owned_controlled_state = {
				limit = { ROOT = { has_full_control_of_state = PREV } }
				prioritize = { 714 }
				create_unit = {
					division = "name = \"1. Northern Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"2. Northern Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
			}
			clr_country_flag = MAN_northern_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_eastern_bandits }
					NOT = { has_country_flag = MAN_western_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}
	MAN_recruit_bandits_west = {
		icon = generic_civil_support

		available = {
			has_country_flag = MAN_western_bandits
			has_completed_focus = MAN_bolster_nationalism
		}
		visible = {
			has_country_flag = MAN_western_bandits
		}
		ai_will_do = {
			factor = 10
		}
		cost = 50
		complete_effect = {
			if = {
				limit = {
					not = {
						has_country_flag = MAN_bandits_recruited
					}
				}
				division_template = {
					name = "Redemption Army"
					priority = 1
					is_locked = yes
					division_names_group = MAN_CAV_01
					regiments = {
						cavalry = { x = 0 y = 0 }
						cavalry = { x = 0 y = 1 }
						cavalry = { x = 0 y = 2 }

						cavalry = { x = 1 y = 0 }
						cavalry = { x = 1 y = 1 }
						cavalry = { x = 1 y = 2 }
					}
				}
				set_country_flag = MAN_bandits_recruited
			}
			random_owned_controlled_state = {
				limit = { ROOT = { has_full_control_of_state = PREV } }
				prioritize = { 610 }
				create_unit = {
					division = "name = \"1. Western Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"2. Western Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
			}
			clr_country_flag = MAN_western_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_eastern_bandits }
					NOT = { has_country_flag = MAN_northern_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}
	MAN_recruit_bandits_east = {
		icon = generic_civil_support

		available = {
			has_country_flag = MAN_eastern_bandits
			has_completed_focus = MAN_bolster_nationalism
		}
		visible = {
			has_country_flag = MAN_eastern_bandits
		}
		ai_will_do = {
			factor = 10
		}
		cost = 50
		complete_effect = {
			if = {
				limit = {
					not = {
						has_country_flag = MAN_bandits_recruited
					}
				}
				division_template = {
					name = "Redemption Army"
					priority = 1
					is_locked = yes
					division_names_group = MAN_CAV_01
					regiments = {
						cavalry = { x = 0 y = 0 }
						cavalry = { x = 0 y = 1 }
						cavalry = { x = 0 y = 2 }

						cavalry = { x = 1 y = 0 }
						cavalry = { x = 1 y = 1 }
						cavalry = { x = 1 y = 2 }
					}
				}
				set_country_flag = MAN_bandits_recruited
			}
			random_owned_controlled_state = {
				limit = { ROOT = { has_full_control_of_state = PREV } }
				prioritize = { 1417 }
				create_unit = {
					division = "name = \"1. Eastern Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"2. Eastern Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
			}
			clr_country_flag = MAN_eastern_bandits
			if = {
				limit = {
					NOT = { has_country_flag = MAN_western_bandits }
					NOT = { has_country_flag = MAN_northern_bandits }
				}
				remove_ideas = MAN_banditry
			}
		}
	}
	MAN_recruit_bandits_generic = {
		icon = generic_civil_support

		available = {
		}
		visible = {
			has_completed_focus = MAN_bolster_nationalism
		}
		ai_will_do = {
			factor = 10
		}
		cost = 50
		fire_only_once = yes
		complete_effect = {
			if = {
				limit = {
					not = {
						has_country_flag = MAN_bandits_recruited
					}
				}
				division_template = {
					name = "Redemption Army"
					priority = 1
					is_locked = yes
					division_names_group = MAN_CAV_01
					regiments = {
						cavalry = { x = 0 y = 0 }
						cavalry = { x = 0 y = 1 }
						cavalry = { x = 0 y = 2 }

						cavalry = { x = 1 y = 0 }
						cavalry = { x = 1 y = 1 }
						cavalry = { x = 1 y = 2 }
					}
				}
				set_country_flag = MAN_bandits_recruited
			}
			random_owned_controlled_state = {
				limit = { ROOT = { has_full_control_of_state = PREV } }
				prioritize = { 328 }
				create_unit = {
					division = "name = \"1. Manchu Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"2. Manchu Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"3. Manchu Redemption Army\" division_template = \"Redemption Army\" start_experience_factor = 0.5" 
					owner = MAN
				}
			}
		}
	}
	MAN_release_bandits = {
		icon = generic_civil_support

		available = {
			
		}
		visible = {
			has_country_flag = MAN_bandits_recruited
		}
		ai_will_do = {
			factor = 1
			modifier = {
				OR = {
					not = {
						has_completed_focus = MAN_independence_war
					}
					has_war = yes	
				}
				factor = 0
			}
		}
		cost = 0
		
		complete_effect = {
			add_manpower = 10000
			delete_unit_template_and_units = { division_template = "Redemption Army" }
			clr_country_flag = MAN_bandits_recruited
		}
	}
}

MAN_war_preparations = {
	MAN_raise_manchu_banner = {
		available = {
			has_war = yes
		}
		visible = {
			has_completed_focus = MAN_five_people_armies
			not = {
				has_country_flag = MAN_manchu_banner_raised
			}
		}
		cost = 25
		ai_will_do = {
			factor = 10
		}
		complete_effect = {
			division_template = {
				name = "Manchu Banner"
				priority = 1
				is_locked = yes
				division_names_group = MAN_INF_01
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 0 y = 3 }
					infantry = { x = 0 y = 4 }

					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
					infantry = { x = 1 y = 3 }
					infantry = { x = 1 y = 4 }

					infantry = { x = 2 y = 0 }
					infantry = { x = 2 y = 1 }
					infantry = { x = 2 y = 2 }
					infantry = { x = 2 y = 3 }
					infantry = { x = 2 y = 4 }
				}
				support = {
					artillery = { x = 0 y = 0 }
				}
			}
			set_country_flag = MAN_manchu_banner_raised
			random_owned_controlled_state = {
				limit = { ROOT = { has_full_control_of_state = PREV } }
				prioritize = { 328 }
				create_unit = {
					division = "name = \"Yellow Banner \" division_template = \"Manchu Banner\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"Red Banner \" division_template = \"Manchu Banner\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"White Banner \" division_template = \"Manchu Banner\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"Blue Banner \" division_template = \"Manchu Banner\" start_experience_factor = 0.5" 
					owner = MAN
				}
				create_unit = {
					division = "name = \"Black Banner \" division_template = \"Manchu Banner\" start_experience_factor = 0.5" 
					owner = MAN
				}
			}
		}
	}

	MAN_disband_the_banners = {
		available = { 

		}
		visible = {
			has_country_flag = MAN_manchu_banner_raised
		}
		cost = 0
		ai_will_do = {
			factor = 1
			modifier = {
				has_war = yes
				factor = 0
			}
		}
		complete_effect = {
			delete_unit_template_and_units = { division_template = "Manchu Banner" }
			clr_country_flag = MAN_manchu_banner_raised
		}
	}
	MAN_fund_underground_gun_shops = {
		available = {
			has_completed_focus = MAN_local_arms_procurement
			has_completed_focus = MAN_purge_the_general_affairs_council
			has_war_with = JAP
		}
		visible = {
			OR = {
				has_completed_focus = MAN_local_arms_procurement
				has_completed_focus = MAN_purge_the_general_affairs_council		
			}
			NOT = {
				has_completed_focus = MAN_five_equal_peoples
			}
			NOT = {
				has_idea = MAN_underground_gun_shops
			}
			has_war_with = JAP
		}
		cost = 50
		ai_will_do = {
			factor = 1
		}
		complete_effect = {
			add_ideas = MAN_underground_gun_shops
			add_offsite_building = { type = arms_factory level = 3 }
		}
	}
	MAN_remove_underground_gun_shops = {
		available = {
			has_idea = MAN_underground_gun_shops
		}
		visible = {
			has_idea = MAN_underground_gun_shops
		}
		cost = 0
		ai_will_do = {
			factor = 1
			modifier = {
				has_war = yes
				factor = 0
			}
		}
		complete_effect = {
			remove_ideas = MAN_underground_gun_shops
			add_offsite_building = { type = arms_factory level = -3 }
		}
	}
	MAN_divert_machine_tools = {
		available = {
			
		}
		visible = {
			has_completed_focus = MAN_request_control_of_the_railways
			not = {
				has_country_flag =  { 
					flag = MAN_machine_tools 
					value = 4
				}
			}
		}
		cost = 50
		ai_will_do = {
			factor = 10
		}
		days_remove = 90
		remove_effect = {
			if = {
				limit = {
					not = {
						has_country_flag = MAN_machine_tools
					}
				}
				set_country_flag = {
					flag = MAN_machine_tools
					value = 1
				}
			}
			else = {
				modify_country_flag = {
					flag = MAN_machine_tools
					value = 1
				}
			}
			random_owned_controlled_state = {
				limit = {
					is_core_of = ROOT 	
					is_fully_controlled_by = ROOT
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
		}
	}
	MAN_prepare_to_seize_arms = {
		available = {
			has_completed_focus = MAN_purge_the_general_affairs_council
			command_power > 29
		}
		visible = {
			has_completed_focus = MAN_purge_the_general_affairs_council
			check_variable = { var = MAN_seize_arms_prep value = 50 compare = less_than }
			is_subject_of = JAP
		}
		cost = 0
		ai_will_do = {
			factor = 10
		}
		complete_effect = {
			add_command_power = -30
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 50 compare = less_than_or_equals }
				}
				custom_effect_tooltip = MAN_can_prepare_more_tt
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 10 compare = less_than }
				}
				set_variable = { var = MAN_seize_arms_prep value = 10 }
			}
			else = {
				add_to_variable = { var = MAN_seize_arms_prep value = 10 }
			}
		}
	}
	MAN_seize_arms = {
		available = {
			has_completed_focus = MAN_independence_war
			has_war_with = JAP
		}
		visible = {
			check_variable = { var = MAN_seize_arms_prep value = 0 compare = greater_than }
		}
		cost = 0
		fire_only_once = yes
		ai_will_do = {
			factor = 10
		}
		complete_effect = {
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 50 compare = less_than_or_equals }
				}
				custom_effect_tooltip = MAN_can_prepare_more_tt
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 10 compare = greater_than_or_equals }
				}
				add_equipment_to_stockpile = { type = infantry_equipment_0 amount = 10000 producer = JAP }
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 20 compare = greater_than_or_equals }
				}
				add_equipment_to_stockpile = { type = infantry_equipment_1 amount = 10000 producer = JAP }
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 30 compare = greater_than_or_equals }
				}
				add_equipment_to_stockpile = { type = artillery_equipment_1 amount = 500 producer = JAP }
				if = {
					limit = {
						JAP = {
							has_tech = improved_infantry_weapons
						}
					}
					add_equipment_to_stockpile = { type = infantry_equipment_2 amount = 2000 producer = JAP }
				}
			}
			if = {
				limit = {
					NOT = {
						has_dlc = "No Step Back"
					}
					check_variable = { var = MAN_seize_arms_prep value = 40 compare = greater_than_or_equals }
				}
				add_equipment_to_stockpile = { type = light_tank_equipment_1 amount = 50 producer = JAP }
				add_equipment_to_stockpile = { type = infantry_equipment_1 amount = 5000 producer = JAP }
			}
			else_if = { 
				limit = {
					has_dlc = "No Step Back"
					check_variable = { var = MAN_seize_arms_prep value = 40 compare = greater_than_or_equals }
				}
				add_equipment_to_stockpile = { type = light_tank_chassis_1 amount = 50 producer = JAP variant_name = "Type 95 Ha-Go"}
				add_equipment_to_stockpile = { type = infantry_equipment_1 amount = 5000 producer = JAP }
			}
			if = {
				limit = {
					NOT = {
						has_dlc = "By Blood Alone"
					}
					check_variable = { var = MAN_seize_arms_prep value = 50 compare = greater_than_or_equals }
				}
				add_equipment_to_stockpile = { type = fighter_equipment_0 amount = 50 producer = JAP }
				if = {
					limit = {
						JAP = {
							has_tech = fighter1
						}
					}
					add_equipment_to_stockpile = { type = fighter_equipment_1 amount = 25 producer = JAP }
				}
				add_equipment_to_stockpile = { type = CAS_equipment_1 amount = 50 producer = JAP }
			}
			else_if = {
				limit = {
					has_dlc = "By Blood Alone"
					check_variable = { var = MAN_seize_arms_prep value = 50 compare = greater_than_or_equals }
				}
				add_equipment_to_stockpile = { type = small_plane_airframe_0 amount = 100 producer = JAP variant_name = "Ki-10" }
				add_equipment_to_stockpile = { type = small_plane_cas_airframe_0 amount = 50 producer = JAP variant_name = "Ki-3"}
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 10 compare = greater_than_or_equals }
					check_variable = { var = MAN_seize_arms_prep value = 20 compare = less_than }
				}
				JAP = {
					add_timed_idea = { idea = MAN_arms_seized_1 days = 30 }
				}
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 20 compare = greater_than_or_equals }
					check_variable = { var = MAN_seize_arms_prep value = 30 compare = less_than }
				}
				JAP = {
					add_timed_idea = { idea = MAN_arms_seized_1 days = 60 }
				}
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 30 compare = greater_than_or_equals }
					check_variable = { var = MAN_seize_arms_prep value = 40 compare = less_than }
				}
				JAP = {
					add_timed_idea = { idea = MAN_arms_seized_2 days = 60 }
				}
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 40 compare = greater_than_or_equals }
					check_variable = { var = MAN_seize_arms_prep value = 50 compare = less_than }
				}
				JAP = {
					add_timed_idea = { idea = MAN_arms_seized_2 days = 90 }
				}
			}
			if = {
				limit = {
					check_variable = { var = MAN_seize_arms_prep value = 50 compare = greater_than_or_equals }
					check_variable = { var = MAN_seize_arms_prep value = 60 compare = less_than }
				}
				JAP = {
					add_timed_idea = { idea = MAN_arms_seized_3 days = 90 }
				}
			}
		}
	}
}

prospect_for_resources = {

	MAN_develop_kirin_aluminium_deposits = { #1435
		
		icon = aluminium

		allowed = {
			original_tag = MAN
		}

		available = {
			has_tech = excavation1
		}
		highlight_states = {
 highlight_state_targets = {
			state = 1435
		} 
}

		visible = {
			has_completed_focus = MAN_develop_aluminum_sources
			controls_state = 1435
			1435 = {
				NOT = {
					has_state_flag = kirin_aluminium_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 2
		}

		ai_will_do = {
			factor = 1
		}
		remove_effect = { 
			1435 = { set_state_flag = kirin_aluminium_developed } 
			1435 = {
				add_resource = {
					type = aluminium
					amount = 12
				}
			}
		}	
	}

	MAN_develop_liaotung_iron_ore_deposits = { #1453
		
		icon = steel

		allowed = {

		}

		highlight_states = {
 highlight_state_targets = {
			state = 1453
		} 
}

		available = {
			has_tech = construction2
			has_tech = excavation1
		}

		visible = {
			has_completed_focus = MAN_expand_showa_steel_works
			controls_state = 1453
			1453 = {
				NOT = {
					has_state_flag = liaotung_steel_developed
				}
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 2
		}

		remove_effect = {
			1453 = { set_state_flag = liaotung_steel_developed }
			1453 = {
				add_resource = {
					type = steel
					amount = 16
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}
}