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

SOV_unit_production = {
	enable = {
		original_tag = SOV
	}
	abort = {
		always = no
	}
	
	ai_strategy = {
		type = role_ratio
		id = garrison
		value = 5
	}

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

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

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

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

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

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

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

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

	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 40 #because doctrine 70
	}
	
	#Air unit factors
	ai_strategy = {
		type = unit_ratio
		id = fighter
		value = 40
	}
	
	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 2 #because doctrine this = 15
	}
	
	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 5
	}
	
	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = -50 # we can add a strategy later to increase this once Germany is beaten
	}
	
	ai_strategy = {
		type = unit_ratio
		id = naval_bomber
		value = 4
	}
	
	
	# Naval unit factors
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 1
	}
	ai_strategy = {
		type = unit_ratio
		id = carrier
		value = 1
	}
	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 30 
	}

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

	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 20
	}
	
	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 20
	}
	
	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 30
	}
	
	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 36
	}
	
	ai_strategy = {
		type = equipment_production_factor
		id = armor
		value = 5
	}
}	

SOV_anti_armor = {
	enable = {
		original_tag = SOV
		ai_wants_divisions > 5 #Decreasing the amount of motorized the AI wants
		
		any_enemy_country = {
			ROOT = {
				estimated_intel_max_armor = {
					tag = PREV
					value > 25
				}
			}
		}
	}
	abort = {
		ai_wants_divisions < 6 #Decreasing the amount of motorized the AI wants
	}

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

southern_thrust = {
	enable = {
		tag = SOV
		has_completed_focus = TAR_prepare_for_slaversbay
		OR = {
			country_exists = IRQ
			country_exists = PER
			country_exists = EGY
		}
	}
	abort = {
		NOT = {
			country_exists = IRQ
			country_exists = PER
			country_exists = EGY
		}
	}
	
	ai_strategy = {
		type = antagonize
		id = "PER"			
		value = 200
	}
	ai_strategy = {
		type = antagonize
		id = "EGY"			
		value = 150
	}	
	ai_strategy = {
		type = antagonize
		id = "IRQ"			
		value = 100
	}	
}

japan_ally = {
	enable = {
		tag = SOV
#		has_completed_focus = SOV_reconcile_japan
		country_exists = JAP
	}
	abort = {
		NOT = { country_exists = JAP }
	}
	
	ai_strategy = {
		type = befriend
		id = "JAP"			
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "JAP"			
		value = 200
	}	
}

spanish_civil_war_SOV = {
	enable = {
		original_tag = SOV
		has_government = communism
		SPR = { has_civil_war = yes }
		NOT = { has_global_flag = scw_over }
	}
	
	abort = {	
		OR = {
			SPR = { has_civil_war = no }
			has_global_flag = scw_over
		}
	}
	
	ai_strategy = {
		type = befriend
		id = "SPR"			
		value = 100
	}	
}

SOV_pp_spending = {
	enable = {
		original_tag = SOV
		has_manpower < 100000
		has_political_power < 200
	}
	abort = {
		OR = {
			has_manpower > 100000
			has_political_power > 200
			date > 1944.1.1
		}
	}

	ai_strategy = { # dont burn PP on admirals if you need manpower laws
		type = pp_spend_priority
		id = admiral
		value = -100
	}
}

SOV_play_nice_with_ribbentrop_pact = {
	enable = {
		tag = SOV
		has_global_flag = sov_yes_pact		
		GER = { has_war_with = POL }
		date < 1941.1.1
	}
	abort = {
		OR ={
			GER = { has_war_with = SOV }
			NOT = { GER = { has_war_with = POL } }
			date > 1941.1.1
		}
	}
	
	# respect the spirit of the law ;)
	ai_strategy = {
		type = send_volunteers_desire
		id = "POL"
		value = -100
	}	
}


SOV_beware_japanese_ambush = {
	enable = {
		tag = SOV
		date > 1940.1.1
		OR = {
			GER = { 
				OR = {
					focus_progress = {
						focus = GER_ussr_war_goal
						progress > 0.2
					}				
					is_justifying_wargoal_against = SOV
				}
			}
			has_war_with = GER
		}

		surrender_progress < 0.1
	}
	abort = {
		surrender_progress >  0.1
	}
	
	ai_strategy = {
		type = prepare_for_war
		id = "JAP"
		value = 100
	}	
}
