
SOV_stay_on_heavy_1 = {
	enable = {
		tag = SOV
		SOV = { has_equipment = { heavy_tank_destroyer_chassis < 5000 } }
		OR = {
			has_country_flag = spacemarine
			has_country_flag = pure_infantry_no_air
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = heavy_tank_destroyer_chassis_1
		value = 100
	}

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = heavy_tank_destroyer_chassis_2
		value = -100
	}

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = heavy_tank_destroyer_chassis_3
		value = -100
	}
}
SOV_stay_on_medium_1_2 = {
	enable = {
		tag = SOV
		SOV = { has_equipment = { medium_tank_chassis < 5000 } }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = heavy_tank_destroyer_chassis_3
		value = -100
	}
}
SOV_tank_is_meta = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_country_flag = grand_battleplan_15w
		has_army_manpower = { size < 2000000 }
		has_global_flag = is_active
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_min_factories_archetype
		id = mechanized_equipment
		value = 5
	}

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

	ai_strategy = {
		type = equipment_production_min_factories_archetype
		id = support_equipment
		value = -4
	}
	
	ai_strategy = {
		type = role_ratio
		id = armor
		value = 10
	}

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

	ai_strategy = {
		type = equipment_production_min_factories
		id = anti_tank
		value = -25
	}
}
SOV_tank_is_meta_boost = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_country_flag = grand_battleplan_15w
		has_army_manpower = { size > 2000000 }
		has_global_flag = is_active
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_factor
		id = armor
		value = 50
	}

	ai_strategy = {
		type = equipment_production_min_factories_archetype
		id = support_equipment
		value = -7
	}

	ai_strategy = {
		type = equipment_production_min_factories_archetype
		id = mechanized_equipment
		value = 28
	}
	
	ai_strategy = {
		type = role_ratio
		id = armor
		value = 20
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -50
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = anti_tank
		value = -25
	}	
	ai_strategy = {
		type = air_factory_balance
		value = -60
	}
}
SOV_land_boost_early_game = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		date < 1940.1.1
		GER = { is_ai = yes }
		has_war = no
		OR = { 
			has_country_flag = grand_battleplan_15w
			has_army_manpower = { size < 4000000 }
		}
		NOT = { 
			OR = {
				has_country_flag = plane_licensed_SOV
				has_tech = improved_small_airframe
			}
		}
	}
	abort_when_not_enabled = yes		
	ai_strategy = {
		type = air_factory_balance
		value = -150
	}
	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = -100
	}
	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = -100
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = strategic_bomber
		value = -100
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = tactical_bomber
		value = -100
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = -20
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = -100
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = -20
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = heavy_fighter
		value = -20
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = strategic_bomber
		value = -20
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = tactical_bomber
		value = -20
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = naval_bomber
		value = -20
	}
}

SOV_land_boost_early_game_vs_GER_human = {
	allowed = {
		original_tag = SOV
	}
	enable = {	
		is_historical_focus_on = yes
		GER = { is_ai = no }
		NOT = { 
			OR = {
				has_country_flag = plane_licensed_SOV
				AND = {
					has_tech = improved_small_airframe
					has_tech = engines_3
					has_tech = aa_hmg
				}
			}
		}
		OR = { 
			has_country_flag = grand_battleplan_15w
			has_army_manpower = { size < 4000000 }
		}
		has_army_manpower = { size < 5000000 }
	}
	abort_when_not_enabled = yes		
	ai_strategy = {
		type = air_factory_balance
		value = -150
	}
	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = -100
	}
	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = -100
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = strategic_bomber
		value = -100
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = tactical_bomber
		value = -100
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = -20
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = -100
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = -20
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = heavy_fighter
		value = -20
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = strategic_bomber
		value = -20
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = tactical_bomber
		value = -20
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = naval_bomber
		value = -20
	}
}
SOV_land_boost_early_game_vs_GER_human_no_air = {
	allowed = {
		original_tag = SOV
	}
	enable = {	
		is_historical_focus_on = yes
		GER = { is_ai = no }
		NOT = { 
			OR = {
				has_country_flag = plane_licensed_SOV
				AND = {
					has_tech = improved_small_airframe
					has_tech = engines_3
					has_tech = aa_hmg
				}
			}
		}
		has_army_manpower = { size < 8000000 }
		has_equipment = { infantry_equipment < 50000 }
		NOT = { has_country_flag = era_of_transition }
		NOT = { GER = { has_idea = endsieg_idea } }
		has_country_flag = pure_infantry_no_air
	}
	abort_when_not_enabled = yes		
	ai_strategy = {
		type = air_factory_balance
		value = -50
	}
	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = -30
	}
	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = -30
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = strategic_bomber
		value = -30
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = tactical_bomber
		value = -30
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = -10
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = -30
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = -10
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = heavy_fighter
		value = -10
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = strategic_bomber
		value = -10
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = tactical_bomber
		value = -10
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = naval_bomber
		value = -10
	}
}

SOV_stalinist_trotskyism = {
	reversed = yes
	allowed = {
		original_tag = SOV
	}
	enable = {
		OR = {
			has_country_flag = SOV_AI_RANDOM_COMMUNIST_HISTORICAL_ALTERNATIVE
			has_game_rule = {
				rule = SOV_ai_behavior
				option = HISTORICAL_ALTERNATIVE
			}
		}
		SOV = { has_completed_focus = SOV_father_of_nations }
		NOT = { is_in_faction_with = SOV }
	}

	abort_when_not_enabled = yes
	ai_strategy = {
		type = antagonize
		id = SOV
		value = 1000
	}
	ai_strategy = {
		type = conquer
		id = SOV
		value = 1000
	}
	ai_strategy = {
		type = declare_war
		id = SOV
		value = 1000
	}

}
SOV_pure_infantry = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_country_flag = pure_infantry
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = cas
		value = 25
	}

	ai_strategy = {
		type = air_factory_balance
		value = 50
	}

}

MON_TAN_war_plan = {
	allowed = {
		OR = {
			tag = MON
			tag = TAN
		}
	}
	enable = {
		is_in_faction_with = SOV
		is_historical_focus_on = yes
		GER = { is_ai = no }
		SOV = { is_ai = yes }
	}

	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = force_defend_ally_borders
		value = 9999
		id = "SOV"
	}
	
	ai_strategy = {
		type = front_unit_request
		tag = GER
		value = 100
	}
	
	ai_strategy = {
		type = garrison
		value = -9999
	}
	
	ai_strategy = {
		type = front_unit_request
		country_trigger = {
			capital_scope = { is_on_continent = asia }
			NOT = { has_war_with = SOV }
			NOT = { has_wargoal_against = SOV }
			NOT = { has_idea = anti_soviet_pact }
			NOT = { is_justifying_wargoal_against = SOV } 
			is_ai = yes
		}
		value = -100
	}
}

SOV_boost_da_air = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_country_flag = plane_licensed_SOV
		SOV_is_deplaned = no
	}

	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = air_factory_balance
		value = 35
	}

}

SOV_make_infantry_early = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		SOV_is_tank_build = yes
		NOT = { has_country_flag = spacemarine }
		num_of_military_factories < 120
		has_army_size = {
			size < 250
			type = infantry
		}
	}

	abort_when_not_enabled = yes	

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = armor
		value = 75
	}

	ai_strategy = {
		type = equipment_production_factor
		id = mechanized
		value = 75
	}

}
SOV_reduce_infantry_1 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		SOV_is_tank_build = yes
		NOT = { has_country_flag = spacemarine }
		has_army_size = {
			size > 250
			type = infantry
		}
		has_army_size = {
			size < 80
			type = armor
		}
	}

	abort_when_not_enabled = yes	

	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -25
	}	

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

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

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

}
SOV_reduce_infantry_2 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		SOV_is_tank_build = yes
		NOT = { has_country_flag = spacemarine }
		has_army_size = {
			size > 300
			type = infantry
		}
		has_army_size = {
			size < 80
			type = armor
		}
	}

	abort_when_not_enabled = yes	

	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -25
	}	

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

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

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

}
SOV_reduce_tank = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		NOT = { has_country_flag = spacemarine }
		has_army_size = {
			size > 80
			type = armor
		}
		has_army_size = {
			size < 400
			type = infantry
		}
	}

	abort_when_not_enabled = yes

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

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

}
SOV_hood_boy = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 119
		NOT = { has_country_flag = spacemarine }
	}

	abort_when_not_enabled = yes	

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

	ai_strategy = {
		type = equipment_production_factor
		id = armor #tanks cannot live under red air
		value = 20
	}
	
	ai_strategy = {
		type = role_ratio
		id = cas
		value = 5
	}

	ai_strategy = {
		type = air_factory_balance
		value = 15
	}

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

}

SOV_hood_boy_2 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 179
		NOT = { has_country_flag = spacemarine }
	}

	abort_when_not_enabled = yes	

	ai_strategy = {
		type = role_ratio
		id = armor
		value = 5 #we wait for the second phase of Barbarossa
	}
	
	ai_strategy = {
		type = role_ratio
		id = cas
		value = 5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = armor #tanks cannot live under red air
		value = 16
	}

	ai_strategy = {
		type = air_factory_balance
		value = 20
	}

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

}

SOV_rich_boy = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 219
		NOT = { has_country_flag = spacemarine }
	}

	abort_when_not_enabled = yes	

	ai_strategy = {
		type = role_ratio
		id = armor
		value = 10
	}
	
	ai_strategy = {
		type = role_ratio
		id = cas
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = armor #tanks cannot live under red air
		value = 25
	}

	ai_strategy = {
		type = air_factory_balance
		value = 25
	}

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

}

SOV_gangster_in_the_town = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 299
		NOT = { has_country_flag = spacemarine }
	}

	abort_when_not_enabled = yes	

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

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

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

}
SOV_hood_boys = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 79
		has_country_flag = spacemarine
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_factor
		id = armor #tanks cannot live under red air
		value = 15
	}	

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

	ai_strategy = {
		type = air_factory_balance
		value = 10
	}

}

SOV_hood_boy_2s = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 149
		has_country_flag = spacemarine
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_factor
		id = armor #tanks cannot live under red air
		value = 15
	}	

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

	ai_strategy = {
		type = air_factory_balance
		value = 10
	}

}

SOV_rich_boys = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 200
		has_country_flag = spacemarine
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_factor
		id = armor #tanks cannot live under red air
		value = 25
	}	

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

	ai_strategy = {
		type = air_factory_balance
		value = 10
	}

}

SOV_spacemarine_prod = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_country_flag = spacemarine
		NOT = { has_tech = advanced_medium_tank_chassis }
	}

	abort_when_not_enabled = yes	

	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 100 #we wait for the second phase of Barbarossa
	}

	ai_strategy = {
		type = equipment_production_factor
		id = armor #tanks cannot live under red air
		value = 50
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = medium_tank_destroyer_chassis_0
		value = 100
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = medium_tank_destroyer_chassis_1
		value = -100
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = medium_tank_destroyer_chassis_2
		value = -100
	}

}

SOV_defend_blitzkrieg  = {#Only perform careful attacks, we want to defend while germany has buffs.
	allowed = {
		original_tag = SOV
	}

	enable = {
		has_war_with = GER
		GER = { has_idea = GER_barbarossa }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control
		country_trigger = {
			OR = {
				tag = GER
				is_in_faction_with = GER
			}
		}

		ratio = 0.4

		priority = 300
		ordertype = front
		execution_type = careful
		execute_order = no
	}

}

SOV_armored_production_1941 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		date > 1941.4.30
		NOT = { has_country_flag = spacemarine }
		has_equipment = { infantry_equipment > 50000 }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio #even more tanks
		id = armor
		value = 30
	}
	
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -5
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = anti_air
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = -5
	}

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

SOV_unit_production_paras = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		always = yes
	}
	abort = {
		always = no
	}

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

SOV_unit_production = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		always = yes
	}
	abort = {
		always = no
	}

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

	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 = 0
	}

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

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

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

	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 80 #because doctrine 70
	}

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

	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 11 #because doctrine this = 15
	}

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

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

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


	# 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_min_factories
		id = convoy
		value = 2
	}

	ai_strategy = {
		type = equipment_production_factor
		id = tactical_bomber
		value = -20
	}

	ai_strategy = {
		type = equipment_production_factor
		id = strategic_bomber
		value = -20
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = -60 #Accounted for
	}

	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = -30
	}

	ai_strategy = {
		type = equipment_production_factor
		id = naval_bomber
		value = -100
	}

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

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

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

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

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = armor
		value = 18
	}
}

SOV_bomber_production = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 30
	}
	abort_when_not_enabled = yes

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

SOV_market_management = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_market_for_sale_factor
		id = infantry
		value = -80  # put less rifles up for sale
	}
}

SOV_default_anti_armor = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		any_country = {
			is_ai = no
			ROOT = {
				estimated_intel_max_armor = {
					tag = PREV
					value > 20
				}
			}
		}
	}
	abort_when_not_enabled = yes

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

SOV_anti_armor = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		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 = motorized
		value = 10
	}
}

southern_thrust = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_the_southern_thrust
		OR = {
			country_exists = IRQ
			country_exists = PER
			country_exists = AFG
		}
	}
	abort = {
		NOT = {
			country_exists = IRQ
			country_exists = PER
			country_exists = AFG
		}
	}

	ai_strategy = {
		type = antagonize
		id = "PER"
		value = 200
	}
	ai_strategy = {
		type = antagonize
		id = "AFG"
		value = 150
	}
	ai_strategy = {
		type = antagonize
		id = "IRQ"
		value = 100
	}
}

claims_on_poland = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_claims_on_poland
		country_exists = POL
	}
	abort = {
		NOT = {
			country_exists = POL
		}
	}

	ai_strategy = {
		type = antagonize
		id = "POL"
		value = 200
	}
}

claims_on_finland = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_secure_leningrad
		country_exists = FIN
		NOT = { controls_state = 146 } #Karelija
		date > 1940.8.1
	}
	abort = {
		OR = {
			NOT = {
				country_exists = FIN
			}
			FIN = {
				has_government = ROOT
			}
			controls_state = 146 #Karelija
		}
	}

	ai_strategy = {
		type = antagonize
		id = "FIN"
		value = 50
	}
}

claims_on_sinkiang = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_spheres_of_influence_in_china
		country_exists = CHI
	}
	abort = {
		NOT = {
			country_exists = CHI
		}
	}

	ai_strategy = {
		type = antagonize
		id = "CHI"
		value = 200
	}
}

japan_ally = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		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
	}
}

dont_give_a_fuck_about_sinkiang = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_two_red_flags
		country_exists = PRC
	}
	abort = {
		NOT = { country_exists = PRC }
	}

	ai_strategy = {
		type = befriend
		id = "SIK"
		value = -9999
	}
	ai_strategy = {
		type = alliance
		id = "SIK"
		value = -9999
	}
}

dont_give_a_fuck_about_mao = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_the_gobi_gambit
		country_exists = SIK
	}
	abort = {
		NOT = { country_exists = SIK }
	}

	ai_strategy = {
		type = befriend
		id = "PRC"
		value = -9999
	}
	ai_strategy = {
		type = alliance
		id = "PRC"
		value = -9999
	}
}

germany_ally = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		OR = {
			has_completed_focus = SOV_anti_capitalist_policies
			GER = { has_completed_focus = GER_alliance_with_the_ussr }
		}
		country_exists = GER
	}
	abort = {
		NOT = { country_exists = GER }
	}

	ai_strategy = {
		type = befriend
		id = "GER"
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 200
	}
}

germany_enemy = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_anti_fascist_policies
		country_exists = GER
		OR = {
			date > 1942.1.1
			has_war_with = GER
		}
	}
	abort = {
		NOT = { country_exists = GER }
	}

	ai_strategy = {
		type = antagonize
		id = "GER"
		value = 200
	}
}

spanish_civil_war_SOV = {
	allowed = {
		original_tag = SOV
		NOT = { has_dlc = "La Resistance" }
	}
	enable = {
		has_government = communism
		has_global_flag = spanish_civil_war
		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
	}
}

spanish_civil_war_SOV_resistance = {
	allowed = {
		original_tag = SOV
		has_dlc = "La Resistance"
	}
	enable = {
		has_government = communism
		country_exists = SPD
		has_global_flag = spanish_civil_war
		NOT = { has_global_flag = scw_over }
	}

	abort = {
		has_global_flag = scw_over
	}

	ai_strategy = {
		type = befriend
		id = "SPD"
		value = 100
	}
	ai_strategy = {
		type = support
		id = "SPD"
		value = 100
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = "SPD"
		value = 100
	}
}

SOV_template_design_1 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		date < 1940.1.1
	}
	abort = {
		date > 1940.1.1
	}

	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 = 50
	}

	ai_strategy = {
		type = template_prio
		id = medium_armor
		value = 10
	}

	ai_strategy = {
		type = template_prio
		id = heavy_armor
		value = 50
	}

	ai_strategy = {
		type = template_prio
		id = paratroopers
		value = 50
	}

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

SOV_template_design_2 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		date > 1940.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = template_prio
		id = mechanized
		value = 20
	}

	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 = 50
	}

	ai_strategy = {
		type = template_prio
		id = modern_armor
		value = 60
	}

	ai_strategy = {
		type = template_prio
		id = heavy_armor
		value = 20
	}

	ai_strategy = {
		type = template_prio
		id = paratroopers
		value = 50
	}

	ai_strategy = {
		type = template_prio
		id = infantry
		value = 10
	}
}

SOV_pp_spending = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		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_decision_pp_spending = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		OR = {
			has_manpower < 100000
			AND = {
				has_war = yes
				has_manpower < 1000000
			}
		}
		has_political_power < 200
		OR = {
			has_idea = volunteer_only
			has_idea = limited_conscription
			has_idea = extensive_conscription
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = { # dont burn PP on decisions and other shit when we are desparate for manpower laws
		type = pp_spend_priority
		id = decision
		value = -100
	}
	ai_strategy = {
		type = pp_spend_priority
		id = guarantee
		value = -200
	}
	ai_strategy = {
		type = pp_spend_priority
		id = relation
		value = -200
	}
}

SOV_play_nice_with_ribbentrop_pact = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		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_naval_role_ratios_historical = {
	allowed = {
		has_dlc = "Man the Guns"
		original_tag = SOV
	}

	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

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

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

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

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

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

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

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

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

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


#SOV_dont_upgrade_to_weapons_2_too_early = {
#	allowed = {
#		original_tag = SOV
#	}
#	enable = {
#		OR = {
#			date < "1943.1.1" # stock up on lots of rifles, we got the manpower
#			AND = {
#				date > "1943.8.1"
#				surrender_progress < 0.1 # if we arent losing badly its ok now
#			}
#		}
#	}
#
#	abort_when_not_enabled = yes
#
#	ai_strategy = {
#		type = production_upgrade_desire_offset
#		id = infantry_equipment_2
#		value = -100
#	}
#}

SOV_home_land_is_safe = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

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

SOV_the_nkvd_is_all_the_intel_we_need = {
	allowed = {
		original_tag = SOV
		has_dlc = "La Resistance"
	}
	enable = {
		has_government = communism
		num_of_civilian_factories < 90
		num_of_civilian_factories > 35
	}
	abort = {
		OR = {
			num_of_civilian_factories > 90
		}
	}
	ai_strategy = {
		type = intelligence_agency_usable_factories
		value = -20
	}
}

SOV_dont_mess_with_volunteers_for_european_democratic_nations = { # Reverse strategy
	reversed = yes
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		has_government = democratic
		SOV = {
			has_government = communism
		}
		NOT = {
			original_tag = SPR
		}

		capital_scope = {
			is_on_continent = europe # lets not mess with europe
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_volunteers_desire
		id = "SOV"
		value = -500
	}
}

SOV_dont_send_volunteers_that_early_to_china = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		JAP = { has_war_with = CHI }
		country_exists = CHI
		CHI = {
			surrender_progress < 0.8
		}
	}

	abort = {
		CHI = {
			surrender_progress > 0.8
		}
		OR = {
			AND = {
				has_completed_focus = SOV_the_gobi_gambit
				country_exists = SIK
			}
			AND = {
				has_completed_focus = SOV_two_red_flags
				country_exists = PRC
			}
			AND = {
				has_completed_focus = SOV_support_the_kuomintang
				country_exists = CHI
			}
		}
	}

	ai_strategy = {
		type = send_volunteers_desire
		id = "CHI"
		value = -800
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = "GXC"
		value = -800
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = "PRC"
		value = -800
	}
}

SOV_dont_send_lend_lease_that_early_to_china = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		JAP = { has_war_with = CHI }
		country_exists = CHI
		CHI = {
			surrender_progress < 0.4
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_lend_lease_desire
		id = CHI
		value = -999
	}
}

SOV_dont_send_lend_lease_to_puppet_of_japan = {
	reversed = yes
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_subject_of = JAP
		JAP = { 
			AND = {
				NOT = { has_government = SOV }
				NOT = { is_in_faction_with = SOV }
				is_in_faction = yes
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_lend_lease_desire
		id = "SOV"
		value = -999
	}
}

SOV_have_some_train_production = {
	allowed = {
		original_tag = SOV
	}

	enable = {
		date > 1936.7.1
		num_of_military_factories > 50
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_min_factories
		id = train
		value = 3
	}
}

# Make people sceptic about sending support to the Whites - again
SOV_dont_support_whites = {

	allowed = { has_dlc = "No Step Back" }
	enable = {
		SOV = { SOV_is_exiles = yes}
		NOT = {
			tag = SOV
		}
	}

	abort = {
		has_global_flag = SOV_soviet_civil_war_over
	}

	ai_strategy = {
		type = alliance
		id = SOV
		value = -200
	}
	ai_strategy = {
		type = befriend
		id = SOV
		value = -100
	}
	ai_strategy = {
		type = support
		id = SOV
		value = -100
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = SOV
		value = -200
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = SOV
		value = -200
	}
}

# Don't ally the Soviet Union if it has civil war
SOV_dont_ally_us_soviet_civil_was = {
	allowed = { always = yes }
	enable = {
		has_global_flag = SOV_soviet_civil_war
		NOT = {
			original_tag = SOV
		}
	}
	abort = {
		has_global_flag = SOV_soviet_civil_war_over
	}
	ai_strategy = {
		type = alliance
		id = SOU
		value = -500
	}
}

SOV_dont_join_wars_during_civil_war = {
	allowed = { always = yes }
	enable = {
		has_global_flag = SOV_soviet_civil_war
		NOT = {
			original_tag = SOV
		}
	}
	abort = {
		has_global_flag = SOV_soviet_civil_war_over
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = SOU
		# target_country = SOV
		value = 200
	}
}

# Make countries want to support the opposition IF
SOV_support_opposition_with_arms = {

	allowed = { always = yes }
	enable = {
		OR = {
			AND = {
				tag = JAP
				SOV = { has_country_flag = SOV_CSW_transfer_vladivostok_flag }
			}
			AND = {
				tag = JAP
				SOV = { has_country_flag = SOV_CSW_transfer_sakhalin_flag }
			}
			AND = {
				tag = GER
				SOV = { has_country_flag = SOV_CSW_baku_oil_flag }
			}
			AND = {
				tag = GER
				SOV = { has_country_flag = SOV_CSW_ukraine_germany_flag }
			}
			AND = {
				tag = ENG
				SOV = { has_country_flag = SOV_CSW_belarus_uk_flag }
			}
			has_country_flag = SOV_supporting_trotsky_flag
		}
		NOT = {
			tag = SOV
		}
	}

	abort = {
		has_global_flag = SOV_soviet_civil_war_over
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = SOV
		value = 100
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = SOV
		value = 300
	}
}

SOV_scorched_earth_german_front_baltics = {

	allowed = { original_tag = SOV }
	enable = {
		has_war_with = GER
		NOT = {
			has_country_flag = SOV_barbarossa_scorched_earth_delay #a 45 day delay at the start of the war before Soviets start doing this
		}
		NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower
			has_manpower < 1000000
			has_political_power < 200
			OR = {
				has_idea = volunteer_only
				has_idea = limited_conscription
				has_idea = extensive_conscription
			}
		}
		count_triggers = {
			amount = 4 #if 4 baltic states are owned by an enemy, burn the rest of the Baltics
			814 = { CONTROLLER = { has_war_with = SOV } }
			11 = { CONTROLLER = { has_war_with = SOV } }
			189 = { CONTROLLER = { has_war_with = SOV } }
			815 = { CONTROLLER = { has_war_with = SOV } }
			190 = { CONTROLLER = { has_war_with = SOV } }
			809 = { CONTROLLER = { has_war_with = SOV } }
			810 = { CONTROLLER = { has_war_with = SOV } }
			808 = { CONTROLLER = { has_war_with = SOV } }
			811 = { CONTROLLER = { has_war_with = SOV } }
			13 = { CONTROLLER = { has_war_with = SOV } }
			812 = { CONTROLLER = { has_war_with = SOV } }
			813 = { CONTROLLER = { has_war_with = SOV } }
			191 = { CONTROLLER = { has_war_with = SOV } }
		}
	}

	abort = {
		OR = {
			NOT = { has_war_with = GER }
			strength_ratio = { tag = GER ratio > 1.5 }
			date > 1944.1.1
		}
	}

	ai_strategy = {
		type = scorched_earth_prio
		id = SOV
		states = {
			814
			11
			189
			815
			190
			809
			810
			808
			811
			13
			812
			813
			191
		}
	}
}

SOV_scorched_earth_german_front_Poland = {

	allowed = { original_tag = SOV }
	enable = {
		has_war_with = GER
		NOT = {
			has_country_flag = SOV_barbarossa_scorched_earth_delay #a 45 day delay at the start of the war before Soviets start doing this
		}
		NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower
			has_manpower < 1000000
			has_political_power < 200
			OR = {
				has_idea = volunteer_only
				has_idea = limited_conscription
				has_idea = extensive_conscription
			}
		}
		count_triggers = {
			amount = 2 #if 2 states are owned by an enemy, burn the rest of the area
			784 = { CONTROLLER = { has_war_with = SOV } }
			96 = { CONTROLLER = { has_war_with = SOV } }
			95 = { CONTROLLER = { has_war_with = SOV } }
			94 = { CONTROLLER = { has_war_with = SOV } }
			93 = { CONTROLLER = { has_war_with = SOV } }
			91 = { CONTROLLER = { has_war_with = SOV } }
			89 = { CONTROLLER = { has_war_with = SOV } }

		}
	}

	abort = {
		OR = {
			NOT = { has_war_with = GER }
			strength_ratio = { tag = GER ratio > 1.5 }
			date > 1944.1.1
		}
	}

	ai_strategy = {
		type = scorched_earth_prio
		id = SOV
		states = {
			784
			96
			95
			94
			93
			91
			89
		}
	}
}

SOV_scorched_earth_german_front_north = {

	allowed = { original_tag = SOV }
	enable = {
		has_war_with = GER
		NOT = {
			has_country_flag = SOV_barbarossa_scorched_earth_delay #a 45 day delay at the start of the war before Soviets start doing this
		}
		NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower
			has_manpower < 1000000
			has_political_power < 200
			OR = {
				has_idea = volunteer_only
				has_idea = limited_conscription
				has_idea = extensive_conscription
			}
		}
		count_triggers = {
			amount = 2 #if 2 states are owned by an enemy, burn the rest of the area
			208 = { CONTROLLER = { has_war_with = SOV } }
			209 = { CONTROLLER = { has_war_with = SOV } }
			210 = { CONTROLLER = { has_war_with = SOV } }
			195 = { CONTROLLER = { has_war_with = SOV } }
			263 = { CONTROLLER = { has_war_with = SOV } }
			246 = { CONTROLLER = { has_war_with = SOV } }


		}
	}

	abort = {
		OR = {
			NOT = { has_war_with = GER }
			strength_ratio = { tag = GER ratio > 1.5 }
			date > 1944.1.1
		}
	}

	ai_strategy = {
		type = scorched_earth_prio
		id = SOV
		states = {
			208
			209
			210
			195
			263
			246
		}
	}
}

SOV_scorched_earth_german_front_center = {

	allowed = { original_tag = SOV }
	enable = {
		has_war_with = GER
		NOT = {
			has_country_flag = SOV_barbarossa_scorched_earth_delay #a 45 day delay at the start of the war before Soviets start doing this
		}
		NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower
			has_manpower < 1000000
			has_political_power < 200
			OR = {
				has_idea = volunteer_only
				has_idea = limited_conscription
				has_idea = extensive_conscription
			}
		}
		count_triggers = {
			amount = 4 #if 4 states are owned by an enemy, burn the rest of the area
			207 = { CONTROLLER = { has_war_with = SOV } }
			206 = { CONTROLLER = { has_war_with = SOV } }
			204 = { CONTROLLER = { has_war_with = SOV } }
			194 = { CONTROLLER = { has_war_with = SOV } }
			201 = { CONTROLLER = { has_war_with = SOV } }
			199 = { CONTROLLER = { has_war_with = SOV } }
			202 = { CONTROLLER = { has_war_with = SOV } }
			193 = { CONTROLLER = { has_war_with = SOV } }
			241 = { CONTROLLER = { has_war_with = SOV } }
			242 = { CONTROLLER = { has_war_with = SOV } }
			243 = { CONTROLLER = { has_war_with = SOV } }
			224 = { CONTROLLER = { has_war_with = SOV } }
		}
	}

	abort = {
		OR = {
			NOT = { has_war_with = GER }
			strength_ratio = { tag = GER ratio > 1.5 }
			date > 1944.1.1
		}
	}

	ai_strategy = {
		type = scorched_earth_prio
		id = SOV
		states = {
			207
			206
			204
			194
			201
			199
			202
			193
			241
			242
			243
			224
		}
	}
}

SOV_scorched_earth_german_front_moscow = {

	allowed = { original_tag = SOV }
	enable = {
		has_war_with = GER
		NOT = {
			has_country_flag = SOV_barbarossa_scorched_earth_delay #a 45 day delay at the start of the war before Soviets start doing this
		}
		NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower
			has_manpower < 1000000
			has_political_power < 200
			OR = {
				has_idea = volunteer_only
				has_idea = limited_conscription
				has_idea = extensive_conscription
			}
		}
		count_triggers = {
			amount = 1 #if 1 states are owned by an enemy, burn the rest of the area
			219 = { CONTROLLER = { has_war_with = SOV } }
			246 = { CONTROLLER = { has_war_with = SOV } }
			242 = { CONTROLLER = { has_war_with = SOV } }
			205 = { CONTROLLER = { has_war_with = SOV } }
			223 = { CONTROLLER = { has_war_with = SOV } }

		}
	}

	abort = {
		OR = {
			NOT = { has_war_with = GER }
			strength_ratio = { tag = GER ratio > 1.5 }
			date > 1944.1.1
		}
		controls_state = 220
		controls_state = 224
		controls_state = 243
		controls_state = 207
		controls_state = 210
	}

	ai_strategy = {
		type = scorched_earth_prio
		id = SOV
		states = {
			219
			246
			242
			205
			223
		}
	}
}

SOV_scorched_earth_german_front_stalingrad = {

	allowed = { original_tag = SOV }
	enable = {
		has_war_with = GER
		NOT = {
			has_country_flag = SOV_barbarossa_scorched_earth_delay #a 45 day delay at the start of the war before Soviets start doing this
		}
		NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower
			has_manpower < 1000000
			has_political_power < 200
			OR = {
				has_idea = volunteer_only
				has_idea = limited_conscription
				has_idea = extensive_conscription
			}
		}
		count_triggers = {
			amount = 1 #if 1 states are owned by an enemy, burn the rest of the area
			217 = { CONTROLLER = { has_war_with = SOV } }
			265 = { CONTROLLER = { has_war_with = SOV } }
			245 = { CONTROLLER = { has_war_with = SOV } }
			238 = { CONTROLLER = { has_war_with = SOV } }
			829 = { CONTROLLER = { has_war_with = SOV } }

		}
	}

	abort = {
		OR = {
			NOT = { has_war_with = GER }
			strength_ratio = { tag = GER ratio > 1.5 }
			date > 1944.1.1
		}
		controls_state = 218
		controls_state = 228
		controls_state = 260
		controls_state = 239
	}

	ai_strategy = {
		type = scorched_earth_prio
		id = SOV
		states = {
			217
			265
			245
			238
			829
		}
	}
}

SOV_dont_do_so_many_naval_invasions_please = {
	allowed = { original_tag = SOV }

	enable = {
		is_historical_focus_on = yes
		FIN = { is_ai = yes }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invasion_unit_request
		tag = GER
		value = -50
	}
	ai_strategy = {
		type = invasion_unit_request
		tag = FIN
		value = -50
	}
}

###########################
### MOLOTOV IN DA HOUSE ###
###########################
#Soviets
SOV_molotov_active_sov = {
	allowed = { original_tag = SOV }

	enable = {
		has_idea = SOV_vyacheslav_molotov
	}

	abort = {
		NOT = { has_idea = SOV_vyacheslav_molotov }
	}

	ai_strategy = {
		type = befriend
		id = GER
		value = 35
	}

	ai_strategy = {
		type = befriend
		id = JAP
		value = 20
	}

	ai_strategy = {
		type = antagonize
		id = POL
		value = 25
	}

	ai_strategy = {
		type = antagonize
		id = FIN
		value = 25
	}

	ai_strategy = {
		type = antagonize
		id = ENG
		value = 15
	}

	ai_strategy = {
		type = antagonize
		id = USA
		value = 15
	}

	ai_strategy = {
		type = antagonize
		id = FRA
		value = 15
	}
}

#Countries that like Molotov
SOV_molotov_active_friendly_others = {
	allowed = {
		OR = {
			original_tag = GER
			original_tag = JAP
		}
	}

	enable = {
		SOV = { has_idea = SOV_vyacheslav_molotov }
	}

	abort = {
		OR = {
			SOV = { NOT = { has_idea = SOV_vyacheslav_molotov } }
			has_capitulated = yes
			is_in_faction_with = SOV
		}
	}

	ai_strategy = {
		type = befriend
		id = SOV
		value = 25
	}
}

#Countries that dislike Molotov
SOV_molotov_active_hostile_others = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = FRA
			original_tag = USA
			original_tag = POL
			original_tag = FIN
			original_tag = SAU #Khakimov incident
		}
	}

	enable = {
		SOV = { has_idea = SOV_vyacheslav_molotov }
	}

	abort = {
		OR = {
			SOV = { NOT = { has_idea = SOV_vyacheslav_molotov } }
			has_capitulated = yes
			is_in_faction_with = SOV
		}
	}

	ai_strategy = {
		type = antagonize
		id = SOV
		value = 25
	}
}


############################
### LITVINOV IN DA HOUSE ###
############################
#Soviets
SOV_litvinov_active_sov = {
	allowed = { original_tag = SOV }

	enable = {
		has_idea = SOV_maksim_litvinov
		is_subject = no
	}

	abort = {
		NOT = { has_idea = SOV_maksim_litvinov }
		is_subject = yes
	}

	ai_strategy = {
		type = befriend
		id = ENG
		value = 25
	}

	ai_strategy = {
		type = befriend
		id = USA
		value = 15
	}

	ai_strategy = {
		type = befriend
		id = FRA
		value = 35
	}

	ai_strategy = {
		type = befriend
		id = POL
		value = 25
	}

	ai_strategy = {
		type = antagonize
		id = GER
		value = 25
	}

	ai_strategy = {
		type = antagonize
		id = JAP
		value = 25
	}

	ai_strategy = {
		type = diplo_action_desire
		id = FRA
		target = improve_relation
		value = 25
	}

	ai_strategy = {
		type = diplo_action_desire
		id = POL
		target = improve_relation
		value = 15
	}
}

#Countries that like Litvinov
SOV_litvinov_active_friendly_others = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = FRA
			original_tag = USA
			original_tag = POL
			original_tag = FIN
			original_tag = SAU #Khakimov incident
		}
	}

	enable = {
		SOV = { has_idea = SOV_maksim_litvinov }
		is_subject = no
	}

	abort = {
		OR = {
			SOV = { NOT = { has_idea = SOV_maksim_litvinov } }
			has_capitulated = yes
			is_in_faction_with = SOV
			is_subject = yes
		}
	}

	ai_strategy = {
		type = befriend
		id = SOV
		value = 25
	}
}

#Countries that dislike Litvinov
SOV_litvinov_active_hostile_others = {
	allowed = {
		OR = {
			original_tag = GER
			original_tag = JAP
		}
	}

	enable = {
		SOV = { has_idea = SOV_maksim_litvinov }
		is_subject = no
	}

	abort = {
		OR = {
			SOV = { NOT = { has_idea = SOV_maksim_litvinov } }
			has_capitulated = yes
			is_in_faction_with = SOV
			is_subject = yes
		}
	}

	ai_strategy = {
		type = antagonize
		id = SOV
		value = 25
	}
}

#########################
### FOREIGN RELATIONS ###
#########################

#Soviets
SOV_khakimov_proposal_sov = {
	allowed = {
		original_tag = SOV
	}

	enable = {
		has_idea = SOV_maksim_litvinov
		has_completed_focus = SOV_the_khakimov_proposal
		SAU = {
			has_opinion = {
				target = SOV
				value < 0
			}
			is_subject = no
		}
		is_subject = no
	}

	abort = {
		OR = {
			NOT = { has_idea = SOV_maksim_litvinov }
			is_in_faction_with = SAU
			SAU = { has_capitulated = yes }
			SAU = { is_subject = no }
			SAU = {
				has_opinion = {
					target = SOV
					value > 75
				}
			}
			is_subject = yes
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = SAU
		target = befriend
		value = 50
	}
	ai_strategy = {
		type = diplo_action_desire
		id = SAU
		target = improve_relation
		value = 50
	}
}

#Soviets
SOV_khakimov_proposal_sau = {
	allowed = {
		original_tag = SAU
	}

	enable = {
		SOV = {
			has_idea = SOV_maksim_litvinov
			has_completed_focus = SOV_the_khakimov_proposal
			is_subject = no
		}
		is_subject = no
	}

	abort = {
		OR = {
			SOV = { NOT = { has_idea = SOV_maksim_litvinov } }
			is_in_faction_with = SOV
			SOV = { has_capitulated = yes }
			is_subject = yes
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = SOV
		target = befriend
		value = 25
	}
}

SOV_unit_buffer_for_asian_threat = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		OR = { #Always have a small unit buffer along the railway, just in case asian fronts get dangerous
			has_war = no
			AND = {
				has_war = yes
				surrender_progress < 0.75
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		# ratio of total armeis in country to be buffered
		ratio = 0.06

		# you can specify an order id. ratio of same orders ids will be share same ratio
		#order_id = 2

		# states to put garrison orders (if no state is friendly, strat is invalid)
		states = {
			564
			563
			566
			567
			561
			657
			408
			409
		}

		# ai areas that the orders will use these buffers in
		area = asia

		# by default if you have orders in target areas, the buffer will request less units.
		# you can override this to disable the feature
		subtract_invasions_from_need = no
		subtract_fronts_from_need = yes
	}
}

SOV_ignore_the_afghanis = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		NOT = {
			OR = {
				has_war_with = AFG
				has_wargoal_against = AFG
				is_justifying_wargoal_against = AFG
				AFG = { has_idea = anti_soviet_pact }
			}
		}
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = front_unit_request
		tag = AFG
		value = -100
	}
}
SOV_ignore_the_finns = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		NOT = {
			OR = {
				has_war_with = FIN
				has_wargoal_against = FIN
				FIN = { is_in_faction = yes }
				has_completed_focus = SOV_secure_leningrad
				focus_progress = {
					focus = SOV_secure_leningrad
					progress > 0
				}
				is_justifying_wargoal_against = FIN
				FIN = { has_idea = anti_soviet_pact }
			}
		}
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = front_unit_request
		tag = FIN
		value = -100
	}
}
SOV_ignore_the_persians = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		NOT = {
			OR = {
				has_war_with = PER
				has_wargoal_against = PER
				PER = { is_in_faction = yes }
				has_completed_focus = SOV_secure_leningrad
				focus_progress = {
					focus = SOV_secure_leningrad
					progress > 0
				}
				is_justifying_wargoal_against = PER
				PER = { has_idea = anti_soviet_pact }
			}
		}
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = front_unit_request
		tag = PER
		value = -100
	}
}

you_dont_matter = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		GER = { is_ai = yes }
		surrender_progress < 0.25
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = front_unit_request
		country_trigger = {
			OR = {
				capital_scope = { is_on_continent = asia }
				capital_scope = { is_on_continent = middle_east }
			}
			NOT = { has_war_with = SOV }
			NOT = { has_wargoal_against = SOV }
			is_in_faction = no
			is_major = no
			NOT = { has_idea = anti_soviet_pact }
			is_ai = yes
			OR = {
				has_government = neutrality
				has_government = communism
			}
			NOT = { is_justifying_wargoal_against = SOV } 
		}
		value = -100
	}
}

you_dont_matter2 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		GER = { is_ai = no }
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = front_unit_request
		country_trigger = {
			OR = {
				capital_scope = { is_on_continent = asia }
				capital_scope = { is_on_continent = middle_east }
			}
			NOT = { has_war_with = SOV }
			NOT = { has_wargoal_against = SOV }
			NOT = { has_idea = anti_soviet_pact }
			is_ai = yes
			NOT = { is_justifying_wargoal_against = SOV } 
		}
		value = -100
	}
}
SOV_coming_to_getcha_iran = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_completed_focus = SOV_preemptive_invasion_of_iran
		PER = {
			exists = yes
			is_in_faction = no
			is_subject = no
			has_capitulated = no
		}
	}
	abort = {
		OR = {
			surrender_progress > 0.5 #we have bigger fish to fry
			PER = {
				OR = {
					exists = no
					is_in_faction = yes
					is_subject = yes
					has_capitulated = yes
				}
			}
		}
	}
	ai_strategy = {
		type = antagonize
		id = PER
		value = 200
	}
	ai_strategy = {
		type = conquer
		id = PER
		value = 200
	}
}

SOV_ENG_tagteam_iran = {
	allowed = {
		OR = {
			original_tag = SOV
			original_tag = ENG
			original_tag = RAJ
		}
	}
	enable = {
		SOV = { has_completed_focus = SOV_preemptive_invasion_of_iran }
		has_global_flag = SOV_agreed_anglo_soviet_invasion_of_iran_flag
		RAJ = {
			is_in_faction_with = ENG
		}
		PER = {
			exists = yes
			is_in_faction = no
			is_subject = no
		}
	}
	abort = {
		OR = {
			surrender_progress > 0.5 #we have bigger fish to fry
			PER = {
				OR = {
					exists = no
					is_in_faction = yes
					is_subject = yes
				}
			}
		}
	}
	ai_strategy = {
		type = conquer
		id = PER
		value = 200
	}
}

SOV_wants_civ_normal = { #let's civ greed a little
	allowed = {
		original_tag = SOV
	}
	enable = {
		SOV_is_ahistorical = no
		date < 1938.5.1
		NOT = { has_global_flag = SOV_no_air }
		OR = {
			AND = {
				difficulty > 1
				NOT = { has_global_flag = mp_difficulty }
				NOT = { has_global_flag = random_difficulty }
			}
			has_country_flag = civ_1
		}
	}

	abort = { 
		OR = {
			GER = { has_war = yes }
			has_war = yes
			has_global_flag = SOV_no_air
			SOV_is_ahistorical = yes
			date > 1938.5.1
			has_country_flag = mil_1
		}
	}
	
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 140
	}
}

SOV_wants_civ_easy = { #let's civ greed a little
	allowed = {
		original_tag = SOV
	}
	enable = {
		SOV_is_ahistorical = no
		date < 1938.9.1
		NOT = { has_global_flag = SOV_no_air }
		OR = {
			AND = {
				difficulty < 2
				difficulty > 0
			}
			has_country_flag = civ_2
		}
	}

	abort = { 
		OR = {
			GER = { has_war = yes }
			has_war = yes
			has_global_flag = SOV_no_air
			SOV_is_ahistorical = yes
			date > 1938.9.1
			has_country_flag = mil_1
		}
	}
	
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 160
	}
}
SOV_wants_civ_veasy = { #let's civ greed a little
	allowed = {
		original_tag = SOV
	}
	enable = {
		SOV_is_ahistorical = no
		date < 1939.1.1
		NOT = { has_global_flag = SOV_no_air }
		OR = {
			difficulty < 1
			has_country_flag = civ_3
		}
	}

	abort = { 
		OR = {
			has_war = yes
			has_global_flag = SOV_no_air
			SOV_is_ahistorical = yes
			date > 1939.1.1
			has_country_flag = mil_1
		}
	}
	
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 220
	}
}

SOV_wants_mil = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		date < 1942.1.1
		OR = {
			has_global_flag = SOV_no_air
			has_country_flag = mil_1
			SOV_is_ahistorical = yes
			date > 1938.8.1
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 200
	}
}

SOV_get_more_mil_again = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_civilian_factories > 150
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 50
	}
}

SOV_get_more_civ_again = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 250
		num_of_civilian_factories < 175
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 150
	}
}

SOV_get_more_civ_again_2 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		num_of_military_factories > 300
		num_of_civilian_factories < 225
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 200
	}
}

SOV_early_game_build_infra_instead = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		date < 1936.5.1
		is_historical_focus_on = yes
		OR = {
			195 = {
				free_building_slots = {
					building = infrastructure
					size > 0
				}
			}
			217 = {
				free_building_slots = {
					building = infrastructure
					size > 0
				}
			}
			219 = {
				free_building_slots = {
					building = infrastructure
					size > 0
				}
			}
			652 = {
				free_building_slots = {
					building = infrastructure
					size > 0
				}
			}
			582 = {
				free_building_slots = {
					building = infrastructure
					size > 0
				}
			}
			586 = {
				free_building_slots = {
					building = infrastructure
					size > 0
				}
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = -200
	}

	ai_strategy = {
		type = building_target
		id = arms_factory
		value = -200
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 195 
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 219 
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 217 
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 652 
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 582 
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 586 
		value = 2000
	}
}

###########################
### avoid attacking the baltics until we have sent ultimatums
###########################
SOV_ultimatum_LIT = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		LIT = {
			NOT = { has_country_flag = SOV_ultimatum_sent_flag }
		}
	}
	abort = {
		OR = {
			LIT = {
				has_country_flag = { flag = SOV_ultimatum_sent_flag value = 1 days > 15 }
			}
			date > 1941.12.31 #If it's late then it's fine
		}
	}

	ai_strategy = {
		type = antagonize
		id = LIT
		value = -50
	}
	ai_strategy = {
		type = conquer
		id = LIT
		value = -200
	}
}

SOV_ultimatum_LAT = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		LAT = {
			NOT = { has_country_flag = SOV_ultimatum_sent_flag }
		}
	}
	abort = {
		OR = {
			LAT = {
				has_country_flag = { flag = SOV_ultimatum_sent_flag value = 1 days > 15 }
			}
			date > 1941.12.31 #If it's late then it's fine
		}
	}

	ai_strategy = {
		type = antagonize
		id = LAT
		value = -50
	}
	ai_strategy = {
		type = conquer
		id = LAT
		value = -200
	}
}

SOV_ultimatum_EST = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		EST = {
			NOT = { has_country_flag = SOV_ultimatum_sent_flag }
		}
	}
	abort = {
		OR = {
			EST = {
				has_country_flag = { flag = SOV_ultimatum_sent_flag value = 1 days > 15 }
			}
			date > 1941.12.31 #If it's late then it's fine
		}
	}

	ai_strategy = {
		type = antagonize
		id = EST
		value = -50
	}
	ai_strategy = {
		type = conquer
		id = EST
		value = -200
	}
}

###########################
### avoid attacking Romania until we have sent ultimatum
###########################

SOV_ultimatum_ROM = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		OR = {
			AND = {
				NOT = { has_government = communism } #Non-commies don't have access to focus Claim in Bessarabia
				date < 1940.1.31 #Do not do it too early buddy
			}
			NOT = { has_completed_focus = SOV_claim_on_bessarabia }
		}
		ROM = {
			NOT = { has_country_flag = SOV_added_claimed_bessarabia } #Added via focus Claim Bessarabia
		}
		OR = {
			NOT = { owns_state = 78 } #Bessarabia
			78 = {
				owner = { NOT = { is_in_faction_with = ROOT } }
			}
		}
		OR = {
			NOT = { owns_state = 80 } #Bucovina
			80 = {
				owner = { NOT = { is_in_faction_with = ROOT } }
			}
		}
		OR = {
			NOT = { owns_state = 766 } #Southern Bessarabia
			766 = {
				owner = { NOT = { is_in_faction_with = ROOT } }
			}
		}
	}
	abort = {
		OR = {
			ROM = {
				has_country_flag = { flag = SOV_added_claimed_bessarabia value = 1 days > 15 }
			}
			date > 1941.12.31 #If it's late then it's fine
			AND = {
				OR = {
					owns_state = 78 #Bessarabia
					78 = {
						owner = { is_in_faction_with = ROOT }
					}
				}
				OR = {
					owns_state = 80 #Bucovina
					80 = {
						owner = { is_in_faction_with = ROOT }
					}
				}
				OR = {
					owns_state = 766 #Southern Bessarabia
					766 = {
						owner = { is_in_faction_with = ROOT }
					}
				}
			}
		}
	}

	ai_strategy = {
		type = ignore
		id = "ROM"
		value = 100
	}

	ai_strategy = {
		type = antagonize
		id = "ROM"
		value = -10
	}
	ai_strategy = {
		type = conquer
		id = "ROM"
		value = -200
	}
}

###########################
### avoid attacking Finland until we have sent ultimatum
###########################

SOV_ultimatum_FIN = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		is_historical_focus_on = yes
		FIN = {
			NOT = { has_country_flag = SOV_ultimatum_sent_flag } #Added via focus Secure Leningrad
		}
		OR = {
			NOT = { owns_state = 146 } #Karjala
			146 = {
				owner = { NOT = { is_in_faction_with = ROOT } }
			}
		}
	}
	abort = {
		OR = {
			FIN = {
				has_country_flag = { flag = SOV_ultimatum_sent_flag value = 1 days > 15 }
			}
			date > 1941.12.31 #If it's late then it's fine
			OR = {
				owns_state = 146 #Karjala
				146 = {
					owner = { is_in_faction_with = ROOT }
				}
			}
		}
	}

	ai_strategy = {
		type = antagonize
		id = FIN
		value = -30
	}
	ai_strategy = {
		type = conquer
		id = FIN
		value = -200
	}
}

###### Don't start ww3 until Japan is defeated

ALLIES_avoid_enemies_for_a_while_ww3 = {
	allowed = {
		OR = {
			original_tag = ENG
			is_in_faction_with = ENG
		}
	}
	enable = {
		is_historical_focus_on = yes
		date > 1943.1.1
		OR = {
			has_war_with = GER
			has_war_with = JAP
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = conquer
		id = PER
		value = -200
	}
	ai_strategy = {
		type = conquer
		id = SOV
		value = -200
	}
}

SOV_defend_leningrad_if_at_war_with_fin = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		FIN = { is_ai = yes }
		NOT = { 
			OR = {
				has_war_with = JAP
				has_war_with = GER
			}
		}
		OR = {
			has_war_with = FIN
			has_wargoal_against = { target = FIN }
			SOV = {
				focus_progress = {
					focus = SOV_secure_leningrad
					progress > 0
				}
			}
		}
	}

	ai_strategy = {
		type = area_priority
		id = winter_war_front
		value = 200
	}

	ai_strategy = {
		type = put_unit_buffers
		ratio = 0.1
		states = {
			195
		}
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
    		type = front_armor_score
    		id = FIN
    		value = 200
	}

	ai_strategy = {
		type = front_control
		state_trigger = {
			OR = {
				state = 195
				state = 146
				state = 928
				state = 111
				state = 927
				state = 926
			}
		}
		tag = FIN

		ratio = 0.15

		priority = 100
		ordertype = front
		execution_type = rush
		execute_order = yes
		manual_attack = yes
	}

	abort_when_not_enabled = yes
}


SOV_defend_leningrad_if_at_war_with_fin_2 = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		FIN = { has_idea = FIN_the_lone_wolf }
		GER = { has_government = fascism }
		NOT = { FIN = { is_in_faction_with = SOV } }
		surrender_progress > 0.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
    		type = front_armor_score
    		id = FIN
    		value = -200
	}

	ai_strategy = {
		type = front_control
		tag = FIN
		ratio = 0.20
		priority = 300
		ordertype = front
		execution_type = balanced
	}

}
SOV_dont_send_all_convoys_on_holiday_to_vladivostok = {
	allowed = { original_tag = SOV }
	enable = {
		has_equipment = {
				convoy < 500
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_avoid_region
		id = 79 #sea of japan
		value = 150
	}
}
SOV_aifc_linear_defence = {
	allowed = { original_tag = SOV }
	enable = {
		is_historical_focus_on = yes
		OR = {
			NOT = { has_completed_focus = SOV_lessons_of_war }
			surrender_progress > 0.30
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_concentration_factor
		value = -300  # Just don't
			 
	}
}

SOV_padding_the_main_gun_for_mediums = {
	allowed = {
		original_tag = GER
	}
	enable = {
		OR = {
			has_tech = basic_medium_tank_chassis
			is_researching_technology = basic_medium_tank_chassis
		}
		NOT = { has_tech = antitank1 }
	}

	abort = {
		has_tech = antitank1
	}

	ai_strategy = {
		type = research_tech
		id = antitank1
		value = 100
	}
}
SOV_padding_the_chassis_for_medium_cannon = {
	allowed = {
		original_tag = GER
	}
	enable = {
		OR = {
			has_tech = antitank1
			is_researching_technology = antitank1
		}
		NOT = { has_tech = basic_medium_tank_chassis }
	}

	abort = {
		has_tech = basic_medium_tank_chassis
	}

	ai_strategy = {
		type = research_tech
		id = basic_medium_tank_chassis
		value = 100
	}
}