###NAVAL AI###
# Example of MTG strategy with all possible roles
#You don't have to set all roles, not setting role == 0 or <0 value
# naval_unit_role_ratios_XXX = {
# 	allowed = {
# 		tag = XXX
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_capital_bb
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_capital_shbb
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_capital_bc
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_carrier
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_submarine
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_screen
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_escort
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_cruiser_light
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_cruiser_heavy
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_mine_sweeper
# 		value = 10
# 	}

# 	ai_strategy = {
# 		type = role_ratio
# 		id = naval_mine_layer
# 		value = 10
# 	}
# }

##### MTG strategies ####
no_old_navy_production = {
	enable = {
		has_navy_size = { size > 0 }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = -10000
	}
	
	ai_strategy = {
		type = role_ratio
		id = naval_capital_shbb
		value = -10000
	}

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bc
		value = -10000
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = -10000
	}

	ai_strategy = {
		type = role_ratio
		id = naval_submarine
		value = -10000
	}

	ai_strategy = {
		type = role_ratio
		id = naval_screen
		value = -10000
	}

	ai_strategy = {
		type = role_ratio
		id = naval_escort
		value = -10000
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = -10000
	}

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

	ai_strategy = {
		type = role_ratio
		id = naval_mine_sweeper
		value = -10000
	}

	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = -10000
	}
}
### Minors ###
naval_unit_role_ratios_minors_coastal = {
	allowed = {
		NOT = {
			tag = ENG
			tag = JAP
			tag = ITA
			tag = GER
			tag = FRA
			tag = USA
			tag = SOV
		}
	}
	enable = { 
		has_navy_size = { size < 50 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 10
	}

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

naval_unit_role_ratios_minors_defensive = {
	allowed = {
		NOT = {
			tag = ENG
			tag = JAP
			tag = ITA
			tag = GER
			tag = FRA
			tag = USA
			tag = SOV
		}
	}
	enable = { 
		has_navy_size = { size < 100 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 20
	}
}

naval_unit_role_ratios_minors_offensive = {
	allowed = {
		NOT = {
			tag = ENG
			tag = JAP
			tag = ITA
			tag = GER
			tag = FRA
			tag = USA
			tag = SOV
		}
	}
	enable = { 
		has_navy_size = { size < 200 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 120
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 10
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 20
	}
}

naval_unit_role_ratios_minors_global = {
	allowed = {
		NOT = {
			tag = ENG
			tag = JAP
			tag = ITA
			tag = GER
			tag = FRA
			tag = USA
			tag = SOV
		}
	}
	enable = {
		has_navy_size = { size < 300 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 250
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 10
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 20
	}
}

### GER ###

naval_unit_role_ratios_GER_prewar_early = {
	allowed = {
		tag = GER
	}
	enable = {
		date < 1938.1.1
		has_war_with_major = no
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 100
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 10
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 500
	}

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 25
	}
}

naval_unit_role_ratios_GER_prewar_late = {
	allowed = {
		tag = GER
	}
	enable = {
		date < 1941.1.1
		date > 1937.12.31
		has_war_with_major = no
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 100
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 20
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 30
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 1500
	}

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 25
	}
}

naval_unit_role_ratios_GER_atwar = {
	allowed = {
		tag = GER
	}
	enable = {
		has_war_with = ENG
		num_of_naval_factories < 35
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 3000
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 60
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 10
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 10
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 5
	}

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 40
	}
}

naval_unit_role_ratios_GER_atwar_many_shipyard = {
	allowed = {
		tag = GER
	}
	enable = {
		has_war_with = ENG
		num_of_naval_factories > 34
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 1500
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 300
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 30
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 20
	}
}

naval_unit_role_ratios_GER_atwar_knock_USA = {
	allowed = {
		tag = GER
	}
	enable = {
		has_war_with = USA
		NOT = { 
			has_war_with = ENG
		}
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 1000
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 300
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 30
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 20
	}

	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 80
	}
}

naval_unit_role_ratios_GER_atwar_No_Naval_Competitor = {
	allowed = {
		tag = GER
	}
	enable = {
		has_war_with_major = yes
		NOT = {
			has_war_with = ENG
			has_war_with = USA
		}
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 100
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 360
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 30
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 30
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 20
	}
}

naval_unit_role_ratios_GER_late_peace = {
	allowed = {
		tag = GER
	}
	enable = {
		date > 1941.1.1
		has_war_with_major = no
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 350
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_cruiser
		value = 10
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 40
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 30
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 100
	}
}
### ENG ###

naval_unit_role_ratios_ENG_prewar_early = {
	allowed = {
		tag = ENG
	}
	enable = {
		date < 1937.6.1
		has_war_with_major = no
	}
	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 200
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 300
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 10
	}

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

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 30
	}
	ai_strategy = {
		type = building_target
		id = dockyard
		value = 30
	}
}

naval_unit_role_ratios_ENG_prewar_late = {
	allowed = {
		tag = ENG
	}
	enable = {
		date < 1941.1.1
		date > 1937.5.31
		has_war_with_major = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 70
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 450
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 350
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 150
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 80
	}

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 45
	}
}

naval_unit_role_ratios_ENG_atwar = {
	allowed = {
		tag = ENG
	}
	enable = {
		has_war_with_major = yes
	}
	abort_when_not_enabled = yes

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

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

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 450
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 150
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 300
	}

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 55
	}
}

naval_unit_role_ratios_ENG_late_peace = {
	allowed = {
		tag = ENG
	}
	enable = {
		date > 1940.12.31
		has_war = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 40
	}

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

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

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

### FRA ###

naval_unit_role_ratios_FRA_prewar = {
	allowed = {
		tag = FRA
	}
	enable = {
		date < 1940.1.1
		has_war_with_major = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 30
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 200
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 30
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 15
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 25
	}
}

naval_unit_role_ratios_FRA_atwar = {
	allowed = {
		tag = FRA
	}
	enable = {
		has_war_with = GER
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 50
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 200
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 15
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 5
	}
}

naval_unit_role_ratios_FRA_atwar_without_germany = {
	allowed = {
		tag = FRA
	}
	enable = {
		has_war_with_major = yes
		NOT = { has_war_with = GER }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 280
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 80
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 250
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_cruiser
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}
}

naval_unit_role_ratios_FRA_late_peace = {
	allowed = {
		tag = FRA
	}
	enable = {
		date > 1939.12.31
		has_war = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 100
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 150
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 300
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 20
	}
}


### SOV ###

naval_unit_role_ratios_SOV_need_to_watch_germany_peace = {
	allowed = {
		tag = SOV
	}
	enable = {
		NOT = { is_ally_with = GER }
		date < 1942.1.1
		has_war_with_major = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 80
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 50
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 10
	}
}

naval_unit_role_ratios_SOV_no_need_to_watch_germany_peace = {
	allowed = {
		tag = SOV
	}
	enable = {
		OR = {
			NOT = { country_exists = GER }
			is_ally_with = GER
			date > 1941.12.31
		}
		has_war_with_major = no
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 140
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 200
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 30
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 10
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 35
	}
}

naval_unit_role_ratios_SOV_atwar_with_Germany = {
	allowed = {
		tag = SOV
	}
	enable = {
		has_war_with = GER
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 30
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = -100
	}
}

naval_unit_role_ratios_SOV_atwar_with_major = {
	allowed = {
		tag = SOV
	}
	enable = {
		NOT = { has_war_with = GER }
		has_war_with_major = yes
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 40
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 300
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 30
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 10
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 50
	}
}

### JAP ###

naval_unit_role_ratios_JAP_prewar_naval_treaty = {
	allowed = {
		tag = JAP
	}
	enable = {
		date < 1939.6.1
		NOT = { 
			any_enemy_country = {
				is_literally_china = no
				is_major = yes
			}
		}
		has_naval_treaty_trigger = yes
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 150
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 250
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 50
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 35
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 60
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier_light
		value = 15
	}
}

naval_unit_role_ratios_JAP_prewar_enough_carrier = {
	allowed = {
		tag = JAP
	}
	enable = {
		date < 1942.1.1
		NOT = { 
			any_enemy_country = {
				is_literally_china = no
				is_major = yes
			}
		}
		has_naval_treaty_trigger = no
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 350
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 350
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 80
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 50
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 60
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 90
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 80
	}
}

naval_unit_role_ratios_JAP_atwar = {
	allowed = {
		tag = JAP
	}
	enable = {
		date > 1942.1.1
		any_enemy_country = {
			is_literally_china = no
			is_major = yes
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 350
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 400
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 60
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 90
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 40
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 120
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 150
	}
}

naval_unit_role_ratios_JAP_late_peace = {
	allowed = {
		tag = JAP
	}
	enable = {
		date > 1941.12.31
		OR = {
			has_war_with_major = no
			any_enemy_country = {
				is_literally_china = yes
				is_major = yes
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 250
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 300
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 65
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 35
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 35
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 50
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 100
	}
}

### USA ###

naval_unit_role_ratios_USA_great_depression = {
	allowed = {
		tag = USA
	}
	enable = {
		date < 1937.2.1
		has_war_with_major = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = -20
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 500
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 200
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 150
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 80
	}
}

naval_unit_role_ratios_USA_go_to_war = {
	allowed = {
		tag = USA
	}
	enable = {
		date > 1937.1.31
		has_war_with_major = no
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 1000
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 450
	}
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 200
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 60
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 120
	}
	
	ai_strategy = {
		type = building_target
		id = dockyard
		value = 75
	}
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 35
	}
}

naval_unit_role_ratios_USA_atwar = {
	allowed = {
		tag = USA
	}
	enable = {
		has_war_with_major = yes
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 800
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 600
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 250
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 130
	}
	
	ai_strategy = {
		type = building_target
		id = dockyard
		value = 125
	}
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 300
	}
	ai_strategy = {
		type = build_ship
		id = capital_ship
		value = 100
	}
	ai_strategy = {
		type = build_ship
		id = carrier
		value = 100
	}
	ai_strategy = {
		type = build_ship
		id = submarine
		value = 100
	}
	ai_strategy = {
		type = build_ship
		id = screen_ship
		value = 100
	}
}

naval_unit_role_ratios_ITA_prewar_build_battleships = {
	allowed = {
		tag = ITA
	}
	enable = {
		date < 1941.1.1
		has_war_with_major = no
		has_navy_size = { size < 8 type = capital_ship archetype = ship_hull_heavy }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 250
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 150
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 40
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 25
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 20
	}
}

naval_unit_role_ratios_ITA_prewar_enough_battleships = {
	allowed = {
		tag = ITA
	}
	enable = {
		date < 1941.1.1
		has_war_with_major = no
		has_navy_size = { size > 7 type = capital_ship archetype = ship_hull_heavy }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 300
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 220
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 80
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 50
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = -20
	}

	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 20
	}
}

naval_unit_role_ratios_ITA_atwar_with_England = {
	allowed = {
		tag = ITA
	}
	enable = {
		has_war_with = ENG
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 450
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 250
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 40
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_cruiser
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 60
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 40
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 75
	}
}

naval_unit_role_ratios_ITA_atwar_with_major = {
	allowed = {
		tag = ITA
	}
	enable = {
		NOT = { has_war_with = ENG }
		has_war_with_major = yes
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 350
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 250
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 40
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_cruiser
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 40
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 30
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 15
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 10
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 90
	}
}

naval_unit_role_ratios_ITA_late_peace = {
	allowed = {
		tag = ITA
	}
	enable = {
		date > 1941.1.1
		has_war_with_major = no
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_submarine
		value = 140
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 100
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen_leader
		value = 10
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_light
		value = 40
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 25
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = 15
	}
	ai_strategy = {
		type = role_ratio
		id = vnr_naval_carrier
		value = 20
	}
}

# naval_unit_role_ratios_majors_lategame = {
	# allowed = {
		# OR = {
			# tag = GER
			# tag = FRA
			# tag = NFA
			# tag = ENG
			# tag = GBR
			# tag = JAP
			# tag = CAN
		# }
	# }
	# enable = { date > 1942.1.1 }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_capital_bb
		# value = 50
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_carrier
		# value = 80
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_cruiser_light
		# value = 50
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_cruiser_heavy
		# value = 20
	# }
# }

### Utility strategies ###

# high_convoy_threat = {
	# allowed = {
		# OR = {
			# tag = GER
			# tag = FRA
			# tag = NFA
			# tag = ENG
			# tag = GBR
			# tag = JAP
			# tag = USA
			# tag = CSA
			# tag = TEX
			# tag = PSA
			# tag = CAN
			# tag = RUS
			# tag = SOV
		# }
	# }
	# enable = {
		# convoy_threat > 0.2
	# }
	# abort = {
		# convoy_threat < 0.2
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_capital_bb
		# value = -50
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_carrier
		# value = -50
	# }

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

	# ai_strategy = {
		# type = role_ratio
		# id = naval_screen
		# value = 200
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_cruiser_light
		# value = -50
	# }

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

	# ai_strategy = {
		# type = role_ratio
		# id = naval_mine_sweeper
		# value = -50
	# }
# }

# high_mine_threat_1 = {
	# allowed = {
		# OR = {
			# tag = GER
			# tag = ENG
			# tag = GBR
			# tag = JAP
			# tag = USA
			# tag = CSA
			# tag = TEX
			# tag = PSA
			# tag = CAN
		# }
	# }
	# enable = {
		# mine_threat > 0.2
	# }
	# abort = {
		# mine_threat < 0.2
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_mine_sweeper
		# value = 25
	# }
# }

# high_mine_threat_2 = {
	# allowed = {
		# OR = {
			# tag = GER
			# tag = ENG
			# tag = GBR
			# tag = JAP
			# tag = USA
			# tag = CSA
			# tag = TEX
			# tag = PSA
			# tag = CAN
		# }
	# }
	# enable = {
		# mine_threat > 0.5
	# }
	# abort = {
		# mine_threat < 0.5
	# }

	# ai_strategy = {
		# type = role_ratio
		# id = naval_mine_sweeper
		# value = 25
	# }
# }

### Convoys ###

we_need_convoys_minors = {
	allowed = {
		NOT = {
			OR = {
				tag = ENG
				tag = FRA
				tag = JAP
				tag = GER
				tag = USA
				tag = ITA
				tag = SOV
			}
		}
	}
	enable = { stockpile_ratio = { archetype = convoy ratio < 75 } }
	abort = { stockpile_ratio = { archetype = convoy ratio > 100 } }

	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 2
	}
}

we_need_convoys_majors1 = {
	allowed = {
		OR = {
			tag = ENG
			tag = FRA
			tag = JAP
			tag = GER
			tag = USA
			tag = ITA
			tag = SOV
		}
	}
	enable = { stockpile_ratio = { archetype = convoy ratio < 75 } }
	abort = { stockpile_ratio = { archetype = convoy ratio > 125 } }

	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 10
	}
}

we_need_convoys_majors2 = {
	allowed = {
		OR = {
			tag = ENG
			tag = FRA
			tag = JAP
			tag = GER
			tag = USA
			tag = ITA
			tag = SOV
		}
	}
	enable = { stockpile_ratio = { archetype = convoy ratio < 125 } }
	abort = { stockpile_ratio = { archetype = convoy ratio > 500 } }

	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 5
	}
}

we_need_convoys_majors3 = {
	allowed = {
		OR = {
			tag = ENG
			tag = FRA
			tag = JAP
			tag = GER
			tag = USA
			tag = ITA
			tag = SOV
		}
	}
	enable = { stockpile_ratio = { archetype = convoy ratio > 500 } }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 2
	}
}

# we_need_convoys_majors3 = {
	# allowed = {
		# OR = {
			# tag = ENG
			# tag = JAP
			# tag = GER
			# tag = USA
			# tag = CSA
			# tag = TEX
			# tag = PSA
		# }
	# }
	# enable = { stockpile_ratio = { archetype = convoy ratio < 250 } }
	# abort = { stockpile_ratio = { archetype = convoy ratio > 300 } }

	# ai_strategy = {
		# type = equipment_production_min_factories
		# id = convoy
		# value = 3
	# }
# }

# we_need_convoys_majors4 = {
	# allowed = {
		# OR = {
			# tag = ENG
			# tag = JAP
			# tag = GER
			# tag = USA
			# tag = CSA
			# tag = TEX
			# tag = PSA
		# }
	# }
	# enable = { stockpile_ratio = { archetype = convoy ratio < 400 } }
	# abort = { stockpile_ratio = { archetype = convoy ratio > 450 } }

	# ai_strategy = {
		# type = equipment_production_min_factories
		# id = convoy
		# value = 2
	# }
# }

we_dont_need_convoys_1 = {
	allowed = {
		NOT = {
			OR = {
				tag = ENG
				tag = FRA
				tag = JAP
				tag = GER
				tag = USA
				tag = ITA
				tag = SOV
			}
		}
	}
	enable = { stockpile_ratio = { archetype = convoy ratio > 200 } }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_variant_production_factor
		id = convoy
		value = -500
	}
}

we_dont_need_convoys_2 = {
	allowed = {
		OR = {
			tag = ENG
			tag = FRA
			tag = JAP
			tag = GER
			tag = USA
			tag = ITA
			tag = SOV
		}
	}
	enable = { stockpile_ratio = { archetype = convoy ratio > 750 } }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_variant_production_factor
		id = convoy
		value = -500
	}
}

we_need_screen_1 = {
	allowed = {
		OR = {
			tag = ENG
			tag = JAP
			tag = USA
		}
	}
	enable = { has_navy_size = { size < 100 archetype = ship_hull_light } }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 500
	}
}

we_need_screen_2 = {
	allowed = {
		OR = {
			tag = FRA
			tag = GER
			tag = ITA
			tag = SOV
		}
	}
	enable = { has_navy_size = { size < 50 archetype = ship_hull_light } }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_screen
		value = 200
	}
}

we_need_cv_planes_1 = {
	allowed = {
		always = yes
	}
	enable = {
		has_navy_size = { size > 0 type = carrier }
		has_navy_size = { size < 4 type = carrier }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_fighter
		value = 3
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_naval_bomber
		value = 3
	}
	
	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_cas
		value = 3
	}
}

we_need_cv_planes_2 = {
	allowed = {
		always = yes
	}
	enable = {
		has_navy_size = { size > 3 type = carrier }
		has_navy_size = { size < 8 type = carrier }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_fighter
		value = 5
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_naval_bomber
		value = 5
	}
	
	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_cas
		value = 5
	}
}

we_need_cv_planes_3 = {
	allowed = {
		always = yes
	}
	enable = {
		has_navy_size = { size > 7 type = carrier }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_fighter
		value = 7
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_naval_bomber
		value = 8
	}
	
	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_cas
		value = 8
	}
}


build_more_missile_cruisers = {
	allowed = {
		always = yes
	}
	enable = {
		has_tech = modern_ship_hull_cruiser
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_cruiser_heavy
		value = 120
	}

	ai_strategy = {
		type = role_ratio
		id = vnr_naval_capital_bb
		value = -80
	}
}

upgrade_cv_plane_strategy_0 = {
	allowed = {
		always = yes
	}
	enable = {
		has_tech = basic_small_airframe
		NOT = { has_tech = improved_small_airframe }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_airframe_1
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_naval_bomber_airframe_1
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_cas_airframe_1
		value = 1000
	}
}

upgrade_cv_plane_strategy_1 = {
	allowed = {
		always = yes
	}
	enable = {
		has_tech = improved_small_airframe
		NOT = { has_tech = advanced_small_airframe }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_airframe_2
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_naval_bomber_airframe_2
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_cas_airframe_2
		value = 1000
	}
}

upgrade_cv_plane_strategy_2 = {
	allowed = {
		always = yes
	}
	enable = {
		has_tech = advanced_small_airframe
		NOT = { has_tech = modern_small_airframe }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_airframe_3
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_naval_bomber_airframe_3
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_cas_airframe_3
		value = 1000
	}
}

upgrade_cv_plane_strategy_3 = {
	allowed = {
		always = yes
	}
	enable = {
		has_tech = modern_small_airframe
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_airframe_4
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_naval_bomber_airframe_4
		value = 1000
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = cv_small_plane_cas_airframe_4
		value = 1000
	}
}

we_dont_need_ocean_liner = {
	allowed = {
		always = yes
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_variant_production_factor
		id = ocean_liner_equipment
		value = -1000
	}
}