# befriend
# conquer
# antagonize
# build_ship
# build_army
# unit_ratio
# build_building
# research_tech
# garrison
# protect
# influence

ZJA_unit_production = {
	enable = {
		tag = ZJA
		date < 1989.1.1
	}
	abort = { 
		date > 1989.1.1
	}
	ai_strategy = { 
		type = role_ratio
		id = infantry
		value = 80
	}	
	ai_strategy = { 
		type = role_ratio
		id = garrison
		value = 12
	}	
	ai_strategy = { 
		type = role_ratio
		id = suppression
		value = 8
	}
	ai_strategy = {
		type = template_prio
		id = motorized
		value = -80
	}
	ai_strategy = {
		type = template_prio
		id = cavalry
		value = -80
	}
	ai_strategy = {
		type = template_prio
		id = mountaineers
		value = -80
	}
	ai_strategy = {
		type = template_prio
		id = infantry
		value = 100
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 20
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 5 #10 to 5
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 20 #From 40 to 20
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = artillery
		value = 5
	}
}
war_with_imperator = {
	enable = {
		tag = ZJA
		ZJA = {
			has_war_with = ZNP
		}
		country_exists = ZNP
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = antagonize
		id = "ZNP"			
		value = 250
	}
	ai_strategy = {
		type = conquer
		id = "ZNP"			
		value = 250
	}	
}


ZJA_template_design = {
	enable = {
		original_tag = ZJA
		date > 1990.1.1				
	}	
	abort_when_not_enabled = yes
	ai_strategy = {
		type = template_prio
		id = infantry
		value = -10
	}
	ai_strategy = {
		type = template_prio
		id = motorized
		value = 10
	}
	ai_strategy = {
		type = template_prio
		id = cavalry
		value = -100
	}	
	ai_strategy = {
		type = template_prio
		id = light_armor
		value = -10
	}
	ai_strategy = {
		type = template_prio
		id = medium_armor
		value = 40
	}	
	ai_strategy = {
		type = template_prio
		id = modern_armor
		value = 50
	}
	ai_strategy = {
		type = template_prio
		id = heavy_armor
		value = -100
	}
	ai_strategy = {
		type = template_prio
		id = paratroopers
		value = -10
	}	
	ai_strategy = {
		type = template_prio
		id = mechanized
		value = 10
	}
}


ZJA_building_boats_is_great = {	
	enable = {
		tag = ZJA
		num_of_civilian_factories_available_for_projects > 15
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 40  #aim for a 2-1 ratio on naval factories
	}
}

ZJA_dont_mess_with_volunteers = { # Reverse strategy
	reversed = yes
	enable = {
		NOT = { tag = ZJA }
		date < 1991.6.1	
		ZJA = {
			OR = {
				has_government = fascism
				has_government = neutrality
			}
		}		
		capital_scope = {
			is_on_continent = europe # lets not mess with europe
		}
	}
	abort = {
		date > 1991.6.1
		ZJA = {
			OR = {
				NOT = {	has_government = fascism }
				NOT = {	has_government = neutrality }
			}
		}
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = "ZJA"
		value = -500
	}
}

ZJA_naval_role_ratios_historical = {
	enable = {
		has_dlc = "Man the Guns"
		original_tag = ZJA
	}
	abort = {
		num_of_naval_factories > 60
	}

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = -120
	}

	ai_strategy = {
		type = role_ratio
		id = naval_capital_shbb
		value = 3
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier_light
		value = 5
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = 15
	}

	ai_strategy = {
		type = role_ratio
		id = naval_submarine
		value = 50
	}

	ai_strategy = {
		type = role_ratio
		id = naval_screen
		value = 100
	}

	ai_strategy = {
		type = role_ratio
		id = naval_escort 
		value = 30
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = 32
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_heavy
		value = -50
	}

	ai_strategy = {
		type = role_ratio
		id = naval_mine_sweeper
		value = 5
	}

	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = 5
	}
	# general building directives
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 2
	}

	ai_strategy = {
		type = unit_ratio
		id = carrier
		value = 4
	}

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 5
	}

	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 40
	}

	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 20
	}
}

ZJA_naval_role_ratios_historical_late = {
	enable = {
		has_dlc = "Man the Guns"
		original_tag = ZJA
		num_of_naval_factories > 60
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = -120
	}

	ai_strategy = {
		type = role_ratio
		id = naval_capital_shbb
		value = 1
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier_light
		value = 5
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = 15
	}

	ai_strategy = {
		type = role_ratio
		id = naval_submarine
		value = 50
	}

	ai_strategy = {
		type = role_ratio
		id = naval_screen
		value = 100
	}

	ai_strategy = {
		type = role_ratio
		id = naval_escort 
		value = 30
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = 30
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_heavy
		value = 5
	}

	ai_strategy = {
		type = role_ratio
		id = naval_mine_sweeper
		value = 5
	}

	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = 5
	}
	# general building directives
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 3
	}

	ai_strategy = {
		type = unit_ratio
		id = carrier
		value = 4
	}

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 5
	}

	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 40
	}

	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 20
	}
}
zja_doesnt_care_about_relation = {
	enable = {
		tag = ZJA
		OR = {
			has_war = yes
			date < 1990.1.1
		}
	}	
	abort = {
		has_war = no
		date > 1990.1.1
	}
	ai_strategy = {
		type = pp_spend_priority
		id = relation
		value = -99
	}
}

ZJA_area_priority = {
	enable = {
		original_tag = ZFA
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = area_priority
		id = europe
		value = 50 
	}	
	ai_strategy = {
		type = area_priority
		id = scandinavia
		value = 20
	}
	ai_strategy = {
		type = area_priority
		id = north_america
		value = 75
	}	
	ai_strategy = {
		type = area_priority
		id = south_america
		value = 20
	}	
	ai_strategy = {
		type = area_priority
		id = asia
		value = 100
	}	
	ai_strategy = {
		type = area_priority
		id = middle_east
		value = 30
	}
	ai_strategy = {
		type = area_priority
		id = suez
		value = 10
	}	
	ai_strategy = {
		type = area_priority
		id = africa
		value = 10
	}	
	ai_strategy = {
		type = area_priority
		id = pacific
		value = 120 #more focus here
	}	
	ai_strategy = {
		type = area_priority
		id = oceania
		value = 120
	}
}

ZJA_we_love_islands = {
	enable = {		 
		original_tag = ZJA
		num_of_naval_factories > 5
	}
	abort_when_not_enabled = yes		
	ai_strategy = {
		type = area_priority
		id = pacific
		value = 120
	}
}

ZJA_anti_imperator_area_prior = {
	enable = {		 
		original_tag = ZJA
		has_war_with = ZNP
	}
	abort_when_not_enabled = yes		
	ai_strategy = {
		type = area_priority
		id = pacific
		value = 50
	}
	ai_strategy = {
		type = area_priority
		id = oceania
		value = 50
	}
}

ZJA_our_ocean_area_prior = {
	enable = {		 
		original_tag = ZJA		
		has_completed_focus = zja_gegemon_na_velikom_okeane	
	}
	abort = {
		always = no
	}	
	ai_strategy = {
		type = area_priority
		id = pacific
		value = 50
	}
	ai_strategy = {
		type = area_priority
		id = oceania
		value = 50
	}
}

ZJA_nashe_mirovoe_more_area_prior = {
	enable = {		 
		original_tag = ZJA		
		has_completed_focus = zja_gegemon_na_mirovom_okeane	
	}
	abort = {
		always = no
	}	
	ai_strategy = {
		type = area_priority
		id = pacific
		value = -50
	}
	ai_strategy = {
		type = area_priority
		id = oceania
		value = -50
	}
}