assernal_of_democracy_USA = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_government = democratic
		ENG = { has_government = democratic }
		is_historical_focus_on = yes
		game_is_on_historical_course = yes
		has_idea = LSM_US_guarantee
		has_country_leader = { ruling_only = yes character = USA_franklin_delano_roosevelt }
		any_state = {
			is_core_of = ENG
			NOT = { is_controlled_by = ENG }
		}
		ENG = {
			surrender_progress > 0.05
			has_idea = LSM_US_guarantee
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 5000
	}

}
sleeper_of_democracy = {
	reversed = yes
	allowed = {
		original_tag = USA
	}
	enable = {
		is_historical_focus_on = yes
		has_war = no
		USA = { has_war = no }
		date < 1941.1.1 #free to intervene at this point
		is_in_faction = no
		NOT = { 
			OR = {
				capital_scope = { is_on_continent = north_america }
				capital_scope = { is_on_continent = south_america }
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = protect
		id = "USA"
		value = -2500
	}
}

assernal_of_democracy_ENG = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		any_state = {
			is_core_of = ENG
			is_in_home_area = yes
			NOT = { is_fully_controlled_by = ENG }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "USA"
		value = 5000
	}

}
USA_early_civ_cost_might_not_worth_it = {
	allowed = {
		original_tag = USA
	}
	enable = {
		OR = {
			has_idea = undisturbed_isolation
			has_idea = isolation	
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = intelligence_agency_usable_factories
		value = -50
	}

}

USA_build_an_air_facility = {
	allowed = {
		original_tag = USA
	}
	enable = {
		NOT = {
			OR = {
				has_idea = isolation
				has_idea = undisturbed_isolation
			}
		}
		air_facility < 1
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = build_building
		id = air_facility
		value = 1
	}
}
USA_build_an_nuclear_facility = {
	allowed = {
		original_tag = USA
	}
	enable = {
		NOT = {
			OR = {
				has_idea = isolation
				has_idea = undisturbed_isolation
			}
		}
		nuclear_facility < 1
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = build_building
		id = nuclear_facility
		value = 1
		target = 4799
	}
}

USA_unit_production = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_historical_focus_on = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}

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

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

	ai_strategy = {
		type = role_ratio
		id = armor
		value = 55
	}

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

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 20
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 25
	}
}
USA_unit_production2 = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_historical_focus_on = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}

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

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

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 20
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 25
	}
}

bba_air_prod_USA = {
	allowed = { original_tag = USA }
	enable = {
		is_historical_focus_on = yes
	}
	abort_when_not_enabled = yes

	#Air unit factors
	ai_strategy = {
		type = unit_ratio
		id = fighter
		value = 50
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 5
	}
	ai_strategy = {
		type = unit_ratio
		id = heavy_fighter
		value = 250
	}

	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = 25
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 37
	}

 	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 10
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = naval_bomber
		value = 32
	}

	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 25
	}

	ai_strategy = {
		type = equipment_production_factor
		id = naval_bomber
		value = 5
	}

	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = 25
	}

	ai_strategy = {
		type = unit_ratio
		id = scout_plane
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = cv_fighter
		value = 10
	}

	ai_strategy = {
		type = unit_ratio
		id = cv_naval_bomber
		value = 10
	}
}

USA_american_imperialism = {
	allowed = {
		original_tag = USA
	}
	enable = {
		AND = {
			OR = {
				has_government = neutrality
				has_government = fascism 
			}
			GER = {
				OR = {
					has_government = neutrality
					has_government = fascism 
				}
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "GER"
		value = 200
	}
}
USA_freedom_and_democracy = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_special_project_completed = sp:sp_nuclear_reactor
	}

	abort = {
		surrender_progress > 0.1
	}

	ai_strategy = {
		type = building_target
		id = nuclear_reactor 
		value = 100
	}

	ai_strategy = {
		type = building_target
		id = nuclear_reactor_heavy_water
		value = 100
	}
}
USA_defend_democracy = {
	allowed = {
		original_tag = USA
	}
	enable = {
		OR = {
			date > 1942.3.1
			AND = {
				ENG = { surrender_progress > 0.30 }
				FRA = { has_capitulated = no }
			}
		}
		is_historical_focus_on = yes
		ENG = { 
			has_government = democratic 
			has_war = yes
			is_faction_leader = yes
			any_country = {
				has_war_with = ENG
				has_government = fascism
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 500
	}
}

ENG_defend_democracy = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		OR = {
			date > 1942.3.1
			AND = {
				ENG = { surrender_progress > 0.30 }
				FRA = { has_capitulated = no }
			}
		}
		is_historical_focus_on = yes
		ENG = { 
			has_government = democratic 
			has_war = yes
			is_faction_leader = yes
			any_country = {
				has_war_with = ENG
				has_government = fascism
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "USA"
		value = 500
	}
}

defender_of_democracy = {
	allowed = { original_tag = USA }
	reversed = yes
	enable = {
		USA = { 
			has_government = democratic
			has_country_flag = what_if_we_guaranteed_poland 
		}
		date > 1939.1.1
		has_government = democratic
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = protect
		id = "USA"
		value = 200
	}
	ai_strategy = {
		type = diplo_action_desire
		id = "USA"
		target = guarantee
		value = 20
	}
}
american_airline_is_peak = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_country_flag = american_airline
	}

	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 30
	}

	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = 50
	}

	ai_strategy = {
		type = air_factory_balance
		value = 300
	}
	
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 100
	}
}

USA_wants_synth = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_tech = synth_oil_experiments 
		OR = {
			AND = {
				has_war = yes
				has_resources_in_country = {
					resource = rubber
					amount < 1
				}
				OR = {
					MAL = { has_capitulated = yes }
					has_war_with = MAL
				}
				OR = {
					INS = { has_capitulated = yes }
					has_war_with = INS
				}
			}
			has_country_flag = american_airline
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 15
	}

	ai_strategy = {
		type = research_weight_factor
		id = synth_oil_experiments
		value = 100
	}

	ai_strategy = {
		type = research_weight_factor
		id = rubber_processing
		value = 100
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_rubber_processing
		value = 100
	}

	ai_strategy = {
		type = research_weight_factor
		id = advanced_rubber_processing
		value = 100
	}

	ai_strategy = {
		type = research_weight_factor
		id = modern_rubber_processing
		value = 100
	}
}

USA_wants_synth_2 = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_tech = synth_oil_experiments
		has_war = yes
		date > 1944.1.1
		has_resources_in_country = {
			resource = rubber
			amount < 1
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 10
	}
}
USA_90_division_gamble = {
	allowed = { original_tag = USA }
	enable = { 
		is_historical_focus_on = yes
		has_war = no
		NOT = { 
			AND = {
				OR = {
					MEX = { has_government = fascism }
					MEX = { has_government = communism }
				}
				MEX = { is_ai = no }
			}
		}
		NOT = { 
			AND = {
				CAN = { has_government = fascism }
				CAN = { is_ai = no }
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = ai_wanted_divisions_factor
		value = -80
	}
}

ahist_USA_add_divisions = {
	allowed = { original_tag = USA }
	enable = { 
		is_historical_focus_on = no
		check_variable = { num_divisions < 170 }
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = ai_wanted_divisions_factor
		value = 100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 200
	}
}

sherman_in_the_town = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_historical_focus_on = yes
		date > 1940.1.1
	}
	abort = {
		always = no
	}

	ai_strategy = {
		type = template_prio
		id = medium_armor
		value = 100
	}
	
	ai_strategy = {
		type = role_ratio
		id = armor
		value = 75
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = armor 
		value = 250
	}
	
	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -15
	}
}

super_fighter_boost_2 = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_war = no
		has_country_flag = plane_licensed
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -35 #downprio this for some more tanks
	}
}


super_cas_boost = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_deployed_air_force_size = {
			type = fighter
			size > 4999
		}
	}
	abort = {
		has_deployed_air_force_size = {
			type = fighter
			size < 1999 #let's stop with CAS
		}
	}
	
	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 20
	}
}

super_cas_boost2 = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_deployed_air_force_size = {
			type = fighter
			size > 8999
		}
	}
	abort = {
		has_deployed_air_force_size = {
			type = fighter
			size < 4999 #let's stop with CAS
		}
	}
	
	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 20
	}
}

super_cas_boost3 = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_deployed_air_force_size = {
			type = fighter
			size > 14999
		}
	}
	abort = {
		has_deployed_air_force_size = {
			type = fighter
			size < 8999 #let's stop with CAS
		}
	}
	
	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 20
	}
}

the_end_of_japan = {
	enable = {
		OR = {
			has_country_flag = era_of_transition
			NOT = {
				any_country = {
					is_major = yes
					has_war_with = ROOT
					OR = {
						capital_scope = { is_on_continent = europe }
						capital_scope = { is_on_continent = north_america }
					}
					has_capitulated = no
				}
			}
			is_historical_focus_on = no
		}
		has_war_with = JAP
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invade
		id = "JAP"
		value = 500
	}

	ai_strategy = {
		type = consider_weak
		id = "JAP"
		value = 75
	}
	
	ai_strategy = {
		type = naval_invasion_dominance_weight
		value = 40
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 72 
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 76 
		value = 100
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 90
		value = 100
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 79
		value = 100
	}
}


USA_nav_fleet = {
	allowed = { original_tag = USA }
	enable = {
		date > 1940.1.1
	}
	abort = {
		always = no
	}

	#Air unit factors

	ai_strategy = {
		type = unit_ratio
		id = cv_fighter
		value = 25
	}

	ai_strategy = {
		type = unit_ratio
		id = cv_naval_bomber
		value = 25
	}

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

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

USA_ask_ENG_FRA_for_access_before_war = {
	allowed = {
		tag = USA
	}
	enable = {
		ENG = { has_war = yes }
		NOT = {
			OR = {
				is_in_faction_with = ENG
				has_military_access_to = ENG
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = diplo_action_desire
		id = ENG
		target = military_access
		value = 1000
	}
}


# USA should put some buffer units in africa and ENG to help with invasions
USA_unit_buffer_for_europe = {
	allowed = {
		tag = USA
	}
	enable = {
		date > 1941.1.1
		is_in_faction_with = ENG

		should_USA_invade_europe_or_africa = yes
		d_day_secured = no
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			128
			129
			338
			123
			122
		}

		ratio = 0.20

		area = europe

		subtract_invasions_from_need = yes
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# spain
		states = {
			171
			180
			112
			179
			795
			169
			173
			167
		}

		ratio = 0.1
		area = europe

		subtract_invasions_from_need = no
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 1

		# north africa
		states = {
			290
			461
			459
			460
			458
			665
			448
			449
			450
			451
			452
			447
		}

		ratio = 0.15

		area = europe

		subtract_invasions_from_need = yes
	}

	ai_strategy = {
  		type = garrison
   		value = -9999
   	}
}

USA_unit_buffer_for_uk_home_island = {
	allowed = {
		tag = USA
	}
	enable = {
		has_war = no
		NOT = { is_in_faction_with = ENG }
		has_military_access_to = ENG
		is_historical_focus_on = yes
		NOT = {
			OR = {
				CAN = { has_government = democratic }
				MEX = { has_government = fascism }
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			128
			129
			338
			123
			122
		}

		ratio = 0.40

		area = europe

		subtract_invasions_from_need = no
		subtract_fronts_from_need = no
	}
}
USA_unit_buffer_for_africa = {
	allowed = {
		tag = USA
	}
	enable = {
		date > 1941.1.1
		is_in_faction_with = ENG
		NOT = { has_global_flag = allied_victory_in_africa }
		d_day_secured = no

		should_USA_invade_europe_or_africa = yes

		all_state = {
			OR = {
				is_on_continent = africa
				AND = {
					GER = {
						divisions_in_state = { state = PREV size < 1 }
					}
					ITA = {
						divisions_in_state = { state = PREV size < 1 }
					}
				}
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 1

		# north africa
		states = {
			290
			461
			459
			460
			458
			665
			448
			449
			450
			451
			452
			447
		}

		ratio = 0.2

		area = africa

		subtract_invasions_from_need = yes
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 1

		# west africa
		states = {
			699
			557
			272
			792
			700
		}

		ratio = 0.15

		area = africa

		subtract_invasions_from_need = no
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 1

		# east africa
		states = {
			559
			269
			268
			550
			551
		}

		ratio = 0.15

		area = africa

		subtract_invasions_from_need = no
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 1

		# south africa
		states = {
			541
			681
			719
		}

		ratio = 0.15

		area = africa

		subtract_invasions_from_need = no
	}
}
USA_sitting_on_my_face = {
	allowed = {
		tag = USA
	}
	enable = {
		is_historical_focus_on = yes
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			629
		}
		ratio = 0.05
		area = pacific
		subtract_invasions_from_need = yes
	}

}

USA_sitting_on_my_lap = {
	enable = {
		is_historical_focus_on = yes
		is_in_faction_with = USA
		capital_scope = {
			OR = {
				is_on_continent = north_america
				is_on_continent = south_america 
			}
		}		
		is_major = no
		629 = { 
			controller = { 
				has_war_with = USA 
				is_ai = no
			} 
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			473
			386
			385
			378
			484
			483
			481
			478
			485
			476
			475
			313
			314
			312
			317
			316
			304
			685
		}
		ratio = 0.60
		area = north_america
		subtract_invasions_from_need = yes
	}
	ai_strategy = {
	    	type = front_control
	    	state_trigger = {
	        	is_on_continent = north_america
	    	}
	    	area = north_america
	    	priority = 99999
	    	ratio = 0
	    	ordertype = front
	   	execution_type = rush
	    	execute_order = yes
	    	manual_attack = yes
	}

}
USA_sitting_on_my_lap_MEX = {
	allowed = {
		OR = {
			tag = MEX
			tag = GUA
			tag = ELS
			tag = HON
			tag = COS
			tag = PAN
			tag = COL
			tag = ECU
		}
	}
	enable = {
		is_historical_focus_on = yes
		is_in_faction_with = USA
		capital_scope = {
			OR = {
				is_on_continent = north_america
				is_on_continent = south_america 
			}
		}		
		is_major = no
		629 = { 
			controller = { 
				has_war_with = USA 
				is_ai = no
			} 
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			378
			484
			483
			481
			478
			485
			476
			475
			313
			314
			312
			317
			316
			304
			685
		}
		ratio = 2.00
		area = north_america
		subtract_invasions_from_need = yes
	}
	ai_strategy = {
	    	type = front_control
	    	state_trigger = {
	        	is_on_continent = north_america
	    	}
	    	area = north_america
	    	priority = 99999
	    	ratio = 0
	    	ordertype = front
	   	execution_type = rush
	    	execute_order = yes
	    	manual_attack = yes
	}

}
USA_gang_up_GER_with_ENG = {
	allowed = {
		tag = USA
	}
	enable = {
		tag = USA
		date > 1940.6.6
		is_in_faction_with = ENG
		NOT = {
			OR = {
				surrender_progress > 0
				any_neighbor_country = {
					is_in_faction_with = USA
					surrender_progress > 0.2
				}
				any_neighbor_country = {
					has_war_with = USA
				}
				any_enemy_country = {		
					NOT = { capital_scope = { is_on_continent = north_america } }
					any_controlled_state = { is_on_continent = north_america }
				}
			}
		}
	}
	abort_when_not_enabled = yes

	# help fronts in europe & africa
	ai_strategy = {
		type = force_defend_ally_borders
		value = 100
		target = europe
	}
	ai_strategy = {
		type = force_defend_ally_borders
		value = 100
		target = africa
	}

}

USA_protect_ourselves = {
	allowed = {
		tag = USA
	}
	enable = {
		OR = {
			any_owned_state = {
				is_core_of = USA
				is_in_home_area = yes
				NOT = { is_controlled_by = USA }
			}
			any_neighbor_country = {
				is_in_faction_with = USA
				surrender_progress > 0.2
			}
			any_neighbor_country = {
				has_war_with = USA
				is_major = yes
				USA = { surrender_progress > 0.10 }
			}
			any_enemy_country = {		
				NOT = { capital_scope = { is_on_continent = north_america } }
				any_controlled_state = { is_on_continent = north_america }
			}
		}
	}
	abort_when_not_enabled = yes

	# help fronts in europe & africa
	ai_strategy = {
		type = dont_defend_ally_borders
		value = 9999
		target = asia
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		value = 9999
		target = africa
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		value = 9999
		target = middle_east
	}

	ai_strategy = {
		type = role_ratio
		id = garrison
		value = 25
	}

	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 50
	}
	ai_strategy = {
		type = front_unit_request
		state_trigger = {
			NOT = { is_core_of = USA }
			NOT = { is_on_continent = north_america } 
			NOT = { is_on_continent = europe } 
		}		
		value = -50
	}

}
USA_home_guard_is_cool = {
	allowed = {
		tag = USA
	}
	enable = {
		surrender_progress > 0
	}
	abort_when_not_enabled = yes
	ai_strategy = {
	    	type = front_control
	    	state_trigger = {
	        	is_core_of = USA
			is_on_continent = north_america
	    	}
	    	priority = 99999
	    	ratio = 0
	    	ordertype = front
	   	execution_type = rush
	    	execute_order = yes
	    	manual_attack = yes
	}
	ai_strategy = {
	    	type = front_unit_request
	    	state_trigger = {
	        	is_core_of = USA
			is_on_continent = north_america
			NOT = { is_fully_controlled_by = USA }
	    	}
	    	value = 50
	}
}
build_patrol_bombers = {
	allowed = {
		tag = USA
	}
	enable = {
		has_dlc = "By Blood Alone"
		has_navy_size = {
			size > 1
		}
		tag = USA
		date > 1940.6.6
		is_in_faction_with = ENG
	}
	abort_when_not_enabled = yes

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

USA_focus_on_africa = {
	allowed = { original_tag = USA }

	enable = {
		is_historical_focus_on = yes
		has_war_with = GER
		has_global_flag = FRA_already_surrendered
		OR = { # Check whole north-african coast
			448 = { CONTROLLER = { has_war_with = ROOT } } # tripoli
			450 = { CONTROLLER = { has_war_with = ROOT } } # benghazi
			458 = { CONTROLLER = { has_war_with = ROOT } } # tunisia
			461 = { CONTROLLER = { has_war_with = ROOT } } # casablanca
			462 = { CONTROLLER = { has_war_with = ROOT } } # marrakech
			459 = { CONTROLLER = { has_war_with = ROOT } } # algiers
			460 = { CONTROLLER = { has_war_with = ROOT } } # constantine
			665 = { CONTROLLER = { has_war_with = ROOT } } # gabès
			449 = { CONTROLLER = { has_war_with = ROOT } } # el agheila
			451 = { CONTROLLER = { has_war_with = ROOT } } # derna
			452 = { CONTROLLER = { has_war_with = ROOT } } # matrouh
			447 = { CONTROLLER = { has_war_with = ROOT } } # alexandria
			446 = { CONTROLLER = { has_war_with = ROOT } } # cairo
			290 = { CONTROLLER = { has_war_with = ROOT } } # spanish africa
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = africa
		value = 60
	}
}
USA_save_the_aussies = {
	allowed = { original_tag = USA }
	enable = {
		has_government = democratic
		is_in_faction = no
		has_war = no

		JAP = {	has_war_with = AST }
		AST = {
			has_government = democratic
			surrender_progress > 0.15
		}
		has_opinion = {
			target = AST
			value > 0 # not if we hate AST
		}
	}
	abort = {
		OR = {
			has_war_with = AST
			is_in_faction_with = JAP
			JAP = {
				NOT = { has_war_with = AST }
			}
		}
	}

	ai_strategy = {
		type = contain
		id = "JAP"
		value = 200
	}

	ai_strategy = {
		type = protect
		id = "AST"
		value = 200
	}
	ai_strategy = {
		type = support
		id = "AST"
		value = 100
	}
}

USA_save_india = { # in the case where japan has beaten china and is moving on india we should step up
	allowed = { original_tag = USA }
	enable = {
		has_government = democratic
		is_in_faction = no
		has_war = no

		JAP = {
			has_war_with = RAJ
			NOT = { has_war_with = CHI }
		}
		RAJ = {
			is_in_faction_with = ENG
			surrender_progress > 0.15
		}
	}
	abort = {
		OR = {
			has_war_with = RAJ
			is_in_faction_with = JAP
			JAP = {
				NOT = { has_war_with = RAJ }
			}
		}
	}

	ai_strategy = {
		type = contain
		id = "JAP"
		value = 200
	}

	ai_strategy = {
		type = protect
		id = "RAJ"
		value = 200
	}
}

USA_stop_soviet_from_falling = {
	allowed = { original_tag = USA }
	enable = {
		has_war = no
		num_divisions > 85 # we must have some divisions ourselves

		NOT = { has_government = fascism }
		NOT = { is_in_faction_with = GER }
		NOT = { has_war_with = SOV }
		GER = {
			has_war_with = SOV
			has_war_with = ENG
			has_government = fascism
		}
		SOV = {
			surrender_progress > 0.05
			has_capitulated = no
		}
	}

	abort = {
		OR = {
			has_war = yes
			has_war_with = SOV
			NOT = { GER = { has_war_with = SOV } }
			is_in_faction_with = GER
			has_government = fascism
			SOV = { has_war = no }
			SOV = { surrender_progress < 0.01 }
		}
	}

	ai_strategy = {
		type = support
		id = "SOV"
		value = 100
	}
}

# this one is same as above, but if you have entered the war yourself
USA_stop_soviet_from_falling_2 = {
	allowed = { original_tag = USA }
	enable = {
		has_war = yes
		NOT = { has_government = fascism }
		NOT = { is_in_faction_with = GER }
		NOT = { has_war_with = SOV }
		GER = {
			has_war_with = SOV
			has_war_with = USA
		}
		SOV = {
			surrender_progress > 0.05
			has_capitulated = no
		}
	}

	abort = {
		OR = {
			has_war = no
			has_war_with = SOV
			NOT = { GER = { has_war_with = SOV } }
			is_in_faction_with = GER
			has_government = fascism
			SOV = { has_war = no }
			SOV = { surrender_progress < 0.01 }
		}
	}

	ai_strategy = {
		type = support
		id = "SOV"
		value = 100
	}
}

USA_garrison_production = {
	allowed = { original_tag = USA }
	enable = {
		ai_wants_divisions >  12 #Massively decreasing the amount of paratroopers the AI wants
	}
	abort = {
		ai_wants_divisions < 13 #Massively decreasing the amount of paratroopers the AI wants
	}

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

USA_garrison_production_game_start = {
	allowed = { original_tag = USA }
	enable = {
		date < 1939.1.1
	}
	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = role_ratio
		id = armor
		value = -50
	}
}
# This will prompt USA to try and support countries who are fighting against extremist elements.
# Should improve alt-history situations like democratic Germany fighting the USSR etc.
USA_protect_against_extremism = { # Reverse strategy
	reversed = yes

	enable_reverse = {
		USA = {
			has_government = democratic
		}
	}

	enable = {
		NOT = { tag = USA }
		NOT = { has_government = communism }
		NOT = { has_government = fascism }
		OR = {
			capital_scope = {
				is_on_continent = europe # lets avoid smaller conflicts elsewhere
			}
			AND = {
				num_of_civilian_factories > 10
				is_subject = no
			}
		}
		any_of_scopes = {
			array = enemies
			NOT = { tag = USA }
			OR = {
				has_government = communism
				has_government = fascism
			}
		}
	}

	abort = {
		OR = {
			has_war = no
			OR = {
				has_government = communism
				has_government = fascism
			}
			USA = {
				OR = {
					NOT = {	has_government = democratic }
					has_war_with = ROOT
				}
			}
		}
	}

	ai_strategy = {
		type = support
		id = "USA"
		value = 100
	}
}

USA_naval_role_ratios_historical = {
	allowed = {
		has_dlc = "Man the Guns"
		original_tag = USA
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bc
		value = 0
	}

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

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

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

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

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

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

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

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

	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 1		 #1 to 2
	}
	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 100		 #1 to 2
	}
	ai_strategy = {
		type = unit_ratio
		id = carrier
		value = 20		 #1 to 2
	}
}

USA_naval_role_ratios_anti_submarine = {
	allowed = {
		has_dlc = "Man the Guns"
		original_tag = USA
	}
	enable = {
		anti_submarine_strategy_required_trigger = yes
	}

	abort = {
		not = { anti_submarine_strategy_required_trigger = yes }
	}

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = 0
	}

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

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

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

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

USA_home_land_is_safe = {
	allowed = { original_tag = USA }
	enable = {
		NOT = {
			OR = {
				has_civil_war = yes
				has_war_with = CAN
				has_war_with = MEX
			}
		}
	}
	abort_when_not_enabled = yes


	ai_strategy = {
		type = garrison
		value = -60
	}
}

ENG_democracy_on_JAP = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		GER = { is_ai = yes }
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
			NOT = {
				any_country = {
					is_major = yes
					has_war_with = ENG
					capital_scope = { is_on_continent = europe }
					has_capitulated = no
					is_ai = no
				}
			}
		}
		any_country = {
			OR = {
				is_in_faction_with = ENG
				is_in_faction_with = USA
				is_subject_of = ENG
				is_subject_of = USA
			}
			JAP = {
				is_justifying_wargoal_against = PREV
				has_war_with = PREV
				has_wargoal_against = PREV
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 72
	}
}
USA_democracy_on_JAP = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		GER = { is_ai = yes }
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
			NOT = {
				any_country = {
					is_major = yes
					has_war_with = ENG
					capital_scope = { is_on_continent = europe }
					has_capitulated = no
					is_ai = no
				}
			}
		}
		any_country = {
			OR = {
				is_in_faction_with = ENG
				is_in_faction_with = USA
				is_subject_of = ENG
				is_subject_of = USA
			}
			JAP = {
				is_justifying_wargoal_against = PREV
				has_war_with = PREV
				has_wargoal_against = PREV
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 75
	}
}
USA_democracy_on_JAP_allies = {
	enable = {
		is_in_faction_with = USA
		has_war_with = JAP
		72 = { controller = { is_in_faction_with = USA } }
		NOT = { controls_state = 645 }
		NOT = { controls_state = 526 }
		JAP = { has_capitulated = no }
		any_country = {
			is_major = yes
			capital_scope = { is_on_continent = europe }
			has_war_with = USA
			has_capitulated = no
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 72 # perl harbor
	}
}

USA_democracy_on_JAP2 = {
	enable = {
		is_in_faction_with = USA
		has_war_with = JAP
		OR = {
			controls_state = 645	
			controls_state = 526 
		}
		JAP = { has_capitulated = no }
		NOT = { 
			any_country = {
				is_major = yes
				capital_scope = { is_on_continent = europe }
				has_war_with = USA
				has_capitulated = no
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 76 # perl harbor
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 79 # perl harbor
	}
}
USA_help_waters_around_GER = {
	allowed = { original_tag = USA }
	enable = {
		is_in_faction_with = ENG
		has_war_with = GER
		ENG = { has_war_with = GER }
		GER = { is_ai = no }
	}
	abort = {
		OR = {
			GER = {
				has_capitulated = yes
			}
			NOT = { has_war_with = GER }
			GER = { is_ai = yes }
		}
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 18 # channel
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16 # channel
	}
}

USA_onto_the_beaches = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_war = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 55
	}
}

USA_convoy_hungrya = {
	enable = {
		date > 1939.1.1
		has_equipment = {
  			convoy < 500
  		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 35
	}
}
USA_convoy_hungryb = {
	enable = {
		date > 1939.1.1
		has_equipment = {
  			convoy < 1500
  		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 35
	}
}
USA_convoy_hungryc = {
	enable = {
		date > 1939.1.1
		has_equipment = {
  			convoy < 2500
  		}
	}
	abort_when_not_enabled = yes

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

GER_is_bad = {
	allowed = {
		tag = USA
	}

	enable = {
		GER = {
			exists = yes
		}
		NOT = { is_ally_with = GER }
		ENG = {
			has_war_with = GER
		}
		has_government = democratic
		ENG = {
			has_government = democratic
		}
		date > 1940.1.1
		NOT = { has_war_with = GER }
		NOT = { has_idea = incredibly_funni_navy_stuffs }
		NOT = { has_idea = incredibly_funni_navy_stuffs_2 }
		GER = { is_ai = no }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = prepare_for_war
		id = GER
		value = 100
	}
}

pacific_preparation = {
	allowed = {
		tag = USA
	}

	enable = {
		JAP = { has_government = fascism }
		JAP = { 
			any_enemy_country = {
				has_government = democratic
				is_major = yes
			}
		}
		USA = { has_civil_war = no }
		has_war = no
		NOT = { has_war_with = JAP }
		NOT = { has_idea = incredibly_funni_navy_stuffs }
		NOT = { has_idea = incredibly_funni_navy_stuffs_2 }
		JAP = { is_ai = no }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = prepare_for_war
		id = JAP
		value = 100
	}

	ai_strategy = {
		type = area_priority
		id = pacific
		value = 50
	}
	
	ai_strategy = {
		type = invade
		id = "JAP"
		value = 500
	}
}

USA_Defends_australia_new_zealand = {
	allowed = {
		tag = USA
	}

	enable = {
		AST = {
			exists = yes
		}
		is_ally_with = USA
	}

	abort_when_not_enabled = yes

	# northen territory
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 520
		value = 10
	}

	#papua
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 523
		value = 10
	}

	#marshall islands
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 633
		value = 10
	}
}

USA_produce_floating_harbors = {
	allowed = {	original_tag = USA }
	enable = {
		is_historical_focus_on = yes
		date > 1941.1.1
		has_war = yes
		num_of_naval_factories > 25
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = unit_ratio
		id = floating_harbor # for floating harbors, 'unit_ratio' is actually not a ratio but an absolute desired number
		value = 10
	}
}

USA_stay_away_from_my_pacific = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_war_with = JAP
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = pacific
		value = 100
	}
}

USA_lets_do_a_navy = {
	allowed = { original_tag = USA }
	enable = {
		is_historical_focus_on = yes
		has_government = democratic
		has_war = no
		has_completed_focus = USA_maritime_commission
		date < 1939.1.1
		any_axis_major_is_human2 = yes
		NOT = {
			AND = {
				OR = {
					has_idea = undisturbed_isolation
					has_idea = isolation
				}
				date < 1938.1.1
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 55
	}
}
USA_lets_do_a_navy_vs_ai = {
	allowed = { original_tag = USA }
	enable = {
		is_historical_focus_on = yes
		has_government = democratic
		has_war = no
		has_completed_focus = USA_maritime_commission
		date < 1939.1.1
		any_axis_major_is_human2 = no
		NOT = {
			AND = {
				OR = {
					has_idea = undisturbed_isolation
					has_idea = isolation
				}
				date < 1938.1.1
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 40
	}
}
USA_lets_do_a_navy_vs_ahist = {
	allowed = { original_tag = USA }
	enable = {
		is_historical_focus_on = no
		date > 1938.4.1
		NOT = {
			AND = {
				OR = {
					has_idea = undisturbed_isolation
					has_idea = isolation
				}
				date < 1938.1.1
			}
		}
		OR = {
			democratic > 0.90
			communism > 0.90
			fascism > 0.90
			neutrality > 0.90
		}
		num_of_military_factories > 100
	}
	abort_when_not_enabled = yes

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

USA_convoy_voy_voy = {
	allowed = { original_tag = USA }
	enable = {
		has_government = democratic
		has_war = no
		has_equipment = {
			convoy < 1000
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 15
	}
}

USA_convoy_voy_voy2 = {
	allowed = { original_tag = USA }
	enable = {
		has_government = democratic
		has_war = yes
		has_equipment = {
			convoy < 2000
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 30
	}
}

poor_economy_no_need_civ = {
	allowed = {
		original_tag = USA
	}
	enable = {
		date < 1938.1.1
		OR = {
			has_idea = undisturbed_isolation
			has_idea = isolation
		}
		has_war = no
		is_historical_focus_on = yes
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = -9999
	}
	ai_strategy = {
		type = building_target
		id = dockyard
		value = -9999
	}
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = -9999
	}
}
USA_srsly_civ_now = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_historical_focus_on = yes
		date > 1938.1.1
		has_idea = partial_economic_mobilisation
		AND = {
			date < 1939.3.1
			has_war = no
			NOT = { 
				JAP = { has_war_with = ENG } 
			}
		}
		NOT = {
			AND = {
				OR = {
					has_idea = undisturbed_isolation
					has_idea = isolation
				}
				date < 1938.1.1
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 170
	}
}

USA_srsly_mils_now = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_historical_focus_on = yes
		OR = {
			date > 1939.3.1
			has_war = yes
			JAP = { has_war_with = ENG }
		}
		NOT = {
			AND = {
				OR = {
					has_idea = undisturbed_isolation
					has_idea = isolation
				}
				date < 1938.1.1
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 200
	}
}


USA_now_we_shall_strike = {
	allowed = {
		original_tag = JAP
	}
	enable = {
		country_exists = JAP

	}

	abort = {
		OR = {
			has_war_with = USA
			NOT = {
				country_exists = USA
			}
		}
	}

	ai_strategy = {
		type = consider_weak
		id = "USA"
		value = 75
	}
}

USA_think_about_retaliation = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_war_with = JAP
		date > 1943.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = home_islands
		value = 100
	}
	
	ai_strategy = {
		type = naval_invasion_dominance_weight
		value = 30
	}

}

USA_go_time = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		has_war_with = JAP
		date > 1943.6.1
		surrender_progress < 0.20
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invade
		id = "JAP"
		value = 200
	}

	ai_strategy = {
		type = consider_weak
		id = "JAP"
		value = 75
	}
	
	ai_strategy = {
		type = naval_invasion_dominance_weight
		value = 40
	}

}

USA_truck_export = { #GM
	allowed = {
		original_tag = USA
	}
	enable = {
		has_dlc = "Arms Against Tyranny"
		date > 1938.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_min_factories
		id = motorized
		value = 1
	}
	ai_strategy = {
		type = equipment_production_factor
		id = motorized
		value = 40
	}
	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = motorized
		value = 100
	}
}

USA_fighter_export = { #GM
	allowed = {
		original_tag = USA
	}
	enable = {
		has_dlc = "Arms Against Tyranny"
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 15
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = 1
	}
	
	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = 15
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = heavy_fighter
		value = 1
	}
	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = fighter
		value = 300 #We mostly use CV fighters
	}
	
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = fighter
		value = -60
	}
}

USA_sugar_daddy_for_UK = {
	allowed = { original_tag = USA }
	enable = {
		NOT = { has_war_with = ENG }
		has_government = democratic
		ENG = {
			has_government = democratic
			has_war = yes
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_lend_lease_desire
		id = ENG
		value = 500
	}
}

USA_sugar_daddy_for_SOV = {
	allowed = { original_tag = USA }
	enable = {
		NOT = { has_war_with = SOV }
		has_government = democratic
		GER = { has_government = fascism }
		SOV = {
			has_war_with = GER
		}
		OR = {
			SOV = { is_ai = yes }
			SOV = { surrender_progress > 0.35 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_lend_lease_desire
		id = SOV
		value = 500
	}
}

USA_dont_guarantee_SA_unless_everyhting_is_shit = {
	allowed = { 
		original_tag = USA 
		has_dlc = "Trial of Allegiance"
	}
	enable = {
		threat < 0.9

	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = protect
		id = CAN
		value = -200
	}
	ai_strategy = {
		type = protect
		id = MEX
		value = -200
	}
	ai_strategy = {
		type = protect
		id = GUA
		value = -200
	}

	ai_strategy = {
		type = protect
		id = HON
		value = -200
	}
	ai_strategy = {
		type = protect
		id = ELS
		value = -200
	}

	ai_strategy = {
		type = protect
		id = NIC
		value = -200
	}
	ai_strategy = {
		type = protect
		id = CUB
		value = -200
	}

	ai_strategy = {
		type = protect
		id = HAI
		value = -200
	}
	ai_strategy = {
		type = protect
		id = DOM
		value = -200
	}
	ai_strategy = {
		type = protect
		id = COS
		value = -200
	}
	ai_strategy = {
		type = protect
		id = PAN
		value = -200
	}
	ai_strategy = {
		type = protect
		id = COL
		value = -200
	}
	ai_strategy = {
		type = protect
		id = VEN
		value = -200
	}

	ai_strategy = {
		type = protect
		id = ECU
		value = -200
	}
	ai_strategy = {
		type = protect
		id = PRU
		value = -200
	}

	ai_strategy = {
		type = protect
		id = BOL
		value = -200
	}
	ai_strategy = {
		type = protect
		id = CHL
		value = -200
	}

	ai_strategy = {
		type = protect
		id = ARG
		value = -200
	}
	ai_strategy = {
		type = protect
		id = PAR
		value = -200
	}

	ai_strategy = {
		type = protect
		id = URG
		value = -200
	}
	ai_strategy = {
		type = protect
		id = BRA
		value = -200
	}
}
USA_arsenal_of_democracy_1943 = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_historical_focus_on = yes
		date > 1942.1.1
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 280
	}
	ai_strategy = {
		type = building_target
		id = dockyard
		value = 100
	}
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 300
	}
}
USA_unbreachable_machine_doll = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_war_with = JAP
		JAP = { is_ai = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 7112 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 4180 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 7195 
		value = 10
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 10048 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 12021 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 4180 
		value = 5
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 12021 
		value = 5
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 13067
		value = 3
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 13091
		value = 3
	}
}
USA_unbreachable_machine_doll_doomsday = {
	allowed = {
		original_tag = USA
	}
	enable = {
		has_war_with = JAP
		JAP = { is_ai = no }
		629 = { controller = { tag = JAP } }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 7315 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 7315 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 10157 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 7386 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 12211 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 12211 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 10183 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 4380 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 610 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 610 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 3644
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 9730 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 9671 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 9671 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 3678
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 9637 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 11859 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 9814 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 9814
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 11757 
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 7517
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 1562
		value = 6
	}

	ai_strategy = {
		type = build_building
		id = bunker
		target = 1562
		value = 6
	}
}
MEX_unbreachable_machine_doll_doomsday = {
	allowed = {
		original_tag = MEX
	}
	enable = {
		has_war_with = JAP
		JAP = { is_ai = no }
		629 = { controller = { tag = JAP } }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 1892 
		value = 3
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 12461 
		value = 3
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 12859 
		value = 3
	}

	ai_strategy = {
		type = build_building
		id = coastal_bunker
		target = 12736 
		value = 3
	}
}

USA_prepare_guam = {
	allowed = {
		original_tag = USA
	}
	enable = {
		date > 1940.1.1
		638 = {
			naval_base < 4
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = build_building
		id = naval_base
		target = 12140
		value = 100
	}
}

USA_prepare_guam_2 = {
	allowed = {
		original_tag = USA
	}
	enable = {
		date > 1943.1.1
		638 = {
			naval_base < 8
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = build_building
		id = naval_base
		target = 12140
		value = 100
	}
}

# GUAM HEADQUARTERS
USA_prepare_guam_3_naval_hq_supply = { 
	allowed = {
		original_tag = USA
		has_dlc = "No Compromise, No Surrender"
	}
	enable = {
		date > 1943.1.1
		638 = {
			OR = {
				naval_headquarters < 1
				naval_supply_hub < 1
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = build_building
		id = naval_headquarters
		target = 12140
		value = 100
	}
	ai_strategy = {
		type = build_building
		id = naval_supply_hub
		target = 12140
		value = 100
	}

}


### FACTION RELATED STRATEGIES

USA_base_faction_priorities = {
	allowed = {
		original_tag = USA
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = spent_faction_initiative_priority
		id = program
		value = 25
	}
	ai_strategy = {
		type = spent_faction_initiative_priority
		id = unlock_faction_commander
		value = 5
	}
}