FIN_NORDIC_is_not_friendly = {
	OR = {
		AND = {
			NOR = { 
				OR = {
					has_completed_focus = NOR_lurk_in_the_shadows
					has_completed_focus = NOR_a_resurgent_labor_movement
				}
			}
			SWE = { 
				OR = {
					has_completed_focus = SWE_prevent_a_red_dictatorship
				}
			}
		}
		AND = {
			SWE = { 
				OR = {
					has_completed_focus = SWE_prevent_a_red_dictatorship
				}
			}
			DEN = { 
				OR = {
					has_completed_focus = DEN_march_on_the_capital
				}
			}
		}
		AND = {
			NOR = { 
				OR = {
					has_completed_focus = NOR_lurk_in_the_shadows
					has_completed_focus = NOR_a_resurgent_labor_movement
				}
			}
			DEN = { 
				OR = {
					has_completed_focus = DEN_march_on_the_capital
				}
			}
		}
	}
}

FIN_NORDIC_is_friendly = {
	OR = {
		AND = {
			SWE = { 
				OR = {
					has_completed_focus = SWE_continue_the_second_industrial_revolution
					has_completed_focus = SWE_the_nordic_defense_council
				}
			}
			NOR = { 
				OR = {
					has_completed_focus = NOR_vote_of_no_confidence
					has_completed_focus = NOR_continue_nygaardsvold_government
					has_completed_focus = NOR_the_chamberlains_overture				
				}
			}
		}
		AND = {
			SWE = { 
				OR = {
					has_completed_focus = SWE_continue_the_second_industrial_revolution
					has_completed_focus = SWE_the_nordic_defense_council
				}
			}
			DEN = { 
				OR = {
					has_completed_focus = DEN_king_assumes_power
					has_completed_focus = DEN_political_unity
				}
			}
		}
		AND = {
			NOR = { 
				OR = {
					has_completed_focus = NOR_vote_of_no_confidence
					has_completed_focus = NOR_continue_nygaardsvold_government
					has_completed_focus = NOR_the_chamberlains_overture				
				}
			}
			DEN = { 
				OR = {
					has_completed_focus = DEN_king_assumes_power
					has_completed_focus = DEN_political_unity
				}
			}
		}
	}
}


can_rely_on_allies = {
	country_exists = ENG
	date < 1940.1.1
	ENG = { is_ai = yes }
	is_historical_focus_on = yes
	ENG = {
		has_government = democratic
		OR = {
			has_country_flag = ENG_AI_DEMOCRATIC_HISTORICAL
			has_game_rule = {
				rule = ENG_ai_behavior 
				option = DEMOCRATIC_HISTORICAL
			}
			has_game_rule = {
				rule = ENG_ai_behavior 
				option = DEFAULT
			}
		}
	} 
}



ENG_is_monarchist = {
	ENG = {	
		is_ai = yes
		OR = {
			has_country_flag = ENG_abdication_crisis_morganatic_marriage
			has_country_flag = ENG_abdication_crisis_normal_marriage
			has_country_flag = ENG_AI_RANDOM_NEUTRALITY
			has_game_rule = {
				rule = ENG_ai_behavior
				option = NEUTRALITY
			}
		}
	}
}



SOV_is_not_historical = {
			SOV = {
				OR = {
					has_completed_focus = SOV_beaten_but_not_defeated
					has_completed_focus = SOV_the_right_opposition
					has_completed_focus = SOV_the_left_opposition
					has_country_flag = SOV_AI_RANDOM_COMMUNIST_LEFT_OPPOSITION
					has_game_rule = {
						rule = SOV_ai_behavior
						option = LEFT_OPPOSITION
					}
					has_country_flag = SOV_AI_RANDOM_COMMUNIST_LEFT_OPPOSITION_COOPERATIVE
					has_game_rule = {
						rule = SOV_ai_behavior
						option = LEFT_OPPOSITION_COOPERATIVE
					}
					has_country_flag = SOV_AI_RANDOM_COMMUNIST_RIGHT_OPPOSITION
					has_game_rule = {
						rule = SOV_ai_behavior
						option = RIGHT_OPPOSITION
					}
					has_country_flag = SOV_AI_RANDOM_COMMUNIST_RIGHT_OPPOSITION_COOPERATIVE
					has_game_rule = {
						rule = SOV_ai_behavior
						option = RIGHT_OPPOSITION_COOPERATIVE
					}
					has_country_flag = SOV_AI_RANDOM_EXILES_TSARIST
					has_game_rule = {
						rule = SOV_ai_behavior
						option = EXILES_TSARIST
					}
					has_country_flag = SOV_AI_RANDOM_EXILES_FASCIST
					has_game_rule = {
						rule = SOV_ai_behavior
						option = EXILES_FASCIST
					}
				}
			}
}

is_ai_generic_need_to_war_as_allied_member = {
	OR = {
		original_tag = NEP
	}
}


AI_need_pure_meat = {
	OR = {
		original_tag = MON
		original_tag = TAN
	}
}

winter_months_are_so_peak = {
	OR = {
		AND = {
			date > 1940.1.1
			date < 1940.4.1
		}
		AND = {
			date > 1941.1.1
			date < 1941.4.1
		}
		AND = {
			date > 1941.12.10
			date < 1942.4.12
		}
		AND = {
			date > 1943.2.1
			date < 1943.4.12
		}
		AND = {
			date > 1944.2.1
			date < 1944.4.12
		}
		AND = {
			date > 1945.2.1
			date < 1945.4.12
		}
	}
}
transition_no_europe_war = {
	OR = {
		has_global_flag = era_of_transition
		NOT = { 
			any_country = {
				capital_scope = { is_on_continent = europe }
				has_war_with = ROOT
				is_major = yes
				has_capitulated = no
			}
		}
	}
}

ITA_is_doing_it_for_us = {
	date < 1939.1.1
	is_historical_focus_on = yes
	ITA = {
		OR = {
			is_ai = yes
			AND = {
				OR = {
					has_tech = aa_hmg
					is_researching_technology = aa_hmg
				}
				OR = {
					has_tech = survivability_studies
					is_researching_technology = survivability_studies
				}
			}
		}			
		OR = {
			AND = {
				has_war = no
				is_in_faction_with = ROOT
			}
			is_historical_focus_on = yes
		}
		OR = {
			has_tech = engines_3
			is_researching_technology = engines_3
		}
		is_subject = no
	}
}
ENG_is_doing_it_for_us = {
	date < 1939.1.1
	is_historical_focus_on = yes
	ENG = {
		OR = {
			is_ai = yes
			AND = {
				OR = {
					has_tech = aa_hmg
					is_researching_technology = aa_hmg
				}
				OR = {
					has_tech = survivability_studies
					is_researching_technology = survivability_studies
				}
			}
		}	
		OR = {
			AND = {
				has_war = no
				is_in_faction_with = ROOT
			}
			is_historical_focus_on = yes
		}
		OR = {
			has_tech = engines_3
			is_researching_technology = engines_3
		}
		is_subject = no
	}
}
is_d_day_preparation_state = {
	is_coastal = yes
	OR = {
		is_core_of = MOR
		is_core_of = EGY
		is_core_of = ALG
		is_core_of = TUN
		is_core_of = LBA
		state = 123
		state = 338
		state = 127
		state = 126
		state = 129
		state = 116
		state = 114
		state = 1
	}
}


can_upgrade_d_day_state_modifier = {
	is_d_day_preparation_state = yes
	NOT = {
		check_variable = { d_day_preparation_production_speed < -0.4 }
		check_variable = { d_day_preparation_non_core_manpower < -0.4 }
		check_variable = { d_day_preparation_local_supplies > 0.4 }
		check_variable = { d_day_preparation_supply_factor > 0.4 }
		check_variable = { d_day_preparation_attrition < -0.4 }
	}
}


SOV_is_careless = {
	NOT = { has_global_flag =  disabled_equipment_funnelling }
	date > 1940.1.1
	NOT = { has_war_with = SOV }
	SOV = { is_ai = no }
	NOT = { SOV = { has_completed_focus = SOV_reconcile_japan } }
	OR = {
		NOT = { country_exists = CHI }
		CHI = { is_in_faction_with = JAP }
		CHI = { is_subject_of = JAP }
		CHI = { has_country_flag = LSM_eligibility_nation }
		613 = { owner = { is_in_faction_with = JAP } }
	}
	OR = {
		NOT = {
			any_state = {
				is_core_of = SOV
				any_neighbor_state = {
					is_core_of = MAN
				}
				SOV = { divisions_in_state = { state = PREV size > 3 } }
			}
		}
		AND = {
			SOV = { 
				divisions_in_state = { state = 408 size < 3 } 
				divisions_in_state = { state = 409 size < 3 } 
				divisions_in_state = { state = 655 size < 3 } 
				divisions_in_state = { state = 657 size < 3 }  
				divisions_in_state = { state = 563 size < 3 } 
				divisions_in_state = { state = 819 size < 3 } 
				divisions_in_state = { state = 817 size < 3 }
			}
		}
		AND = {
			SOV = { 
				is_ai = no
				divisions_in_state = { state = 408 size < 8 }
			}
		}
	}
}

JAP_against_SOV = {
	has_country_flag = JAP_strike_north
}


SOV_is_ahistorical = {
	OR = {
		has_completed_focus = SOV_the_right_opposition
		has_completed_focus = SOV_the_left_opposition
		has_completed_focus = SOV_beaten_but_not_defeated
	}
}

generic_gun_3 = {
	NOT = { has_country_flag = gun_2_ai }
	NOT = { tag = VEN }
	NOT = { tag = TAN }
	NOT = { tag = MAL }
	NOT = { tag = MEN }
	NOT = { tag = BEL }
	NOT = { tag = LBA }
}

generic_gun_2 = {
	OR = {
		has_country_flag = gun_2_ai
		tag = MEN
		tag = TAN
		tag = VEN
		tag = MAL
		tag = BEL
		tag = LBA
	}
}

is_ai_fascist_generic = {
	has_focus_tree = generic_focus
	OR = {
		has_country_flag = fascist_generic_flag
		AND = {
			is_historical_focus_on = yes
			OR = {
				tag = SIA
				tag = POR
				tag = SPR
				tag = AOI
				tag = BUL
			}
		}
	}
}

is_ai_communist_generic = {
	has_focus_tree = generic_focus
	has_country_flag = communist_generic_flag
}

maybe_england_is_eligible_target = {
	capital_scope = { 
		OR = {
			is_on_continent = europe
			is_on_continent = north_america
		}
	}
	NOT = {
		any_state = {
			is_core_of = ENG
			is_in_home_area = yes
			ENG = { divisions_in_state = { state = PREV size > 4 } }
		}
	}
}

not_ready_for_tier_5_tech = {
	original_tag = SOV
	date < 1942.1.1
	has_completed_focus = SOV_industrial_modernization
	NOT = { has_tech = flexible_line }
	NOT = { has_tech = streamlined_line }
	NOT = { has_tech = dispersed_industry5 }
	NOT = { has_tech = concentrated_industry5 }
	NOT = { is_researching_technology = dispersed_industry5 }
	NOT = { is_researching_technology = concentrated_industry5 }
	NOT = { is_researching_technology = flexible_line }
}
not_ready_for_tier_4_tech = {
	original_tag = SOV
	date < 1942.1.1
	has_completed_focus = SOV_reorganize_the_pc_of_heavy_industry
	OR = {
		NOT = { has_tech = advanced_machine_tools } 
		NOT = { has_tech = assembly_line_production }
		AND = {
			NOT = { has_tech = dispersed_industry3 } 
			NOT = { has_tech = concentrated_industry3 }  
		}
		AND = {
			NOT = { has_tech = dispersed_industry4 } 
			NOT = { has_tech = concentrated_industry4 }
		}
	}
}
can_do_molotov_ribbentrop = {
	NOT = { has_completed_focus = GER_bulwark_against_bolshevism }
	NOT = { has_completed_focus = GER_the_great_red_menace }
	NOT = { has_global_flag = beck_ribbentrop_signed }
}
intel_vs_allies_tier1 = { 
	any_country = {
		is_axis_ai = yes
		is_in_faction_with = GER
		intel_level_over = {
			target = ENG
			army_intel > 0.49
			navy_intel > 0.49
		}
	}
}
 
intel_vs_allies_tier2 = { 
	any_country = {
		is_axis_ai = yes
		is_in_faction_with = GER
		intel_level_over = {
			target = ENG
			army_intel > 0.69
			navy_intel > 0.69
		}
	}
} 
intel_vs_allies_tier3 = { 
	any_country = {
		is_axis_ai = yes
		is_in_faction_with = GER
		intel_level_over = {
			target = ENG
			army_intel > 0.79
			navy_intel > 0.79
		}
	}
} 
intel_vs_allies_tier4 = { 
	any_country = {
		is_axis_ai = yes
		is_in_faction_with = GER
		intel_level_over = {
			target = ENG
			army_intel > 0.89
			navy_intel > 0.89
		}
	}
} 
intel_vs_allies_tier5 = { 
	any_country = {
		is_axis_ai = yes
		is_in_faction_with = GER
		is_fully_decrypted = ENG
	}
}
GER_is_human_yes_air = { #we ditch air completely if GER has 2/4 tech cuz only humans will do that
	GER = { 
		NOT = { has_country_flag = LSM_endsieg_has_begun }
		is_ai = no 
		date > 1938.1.1 
		OR = {
			AND = {
				has_tech = range_improvements
				OR = {
					has_tech = aa_hmg
					has_tech = improved_small_airframe
					has_tech = survivability_studies
				}
			}
			AND = {
				has_tech = aa_hmg
				OR = {
					has_tech = range_improvements
					has_tech = improved_small_airframe
					has_tech = survivability_studies
				}
			}
			AND = {
				has_tech = improved_small_airframe
				OR = {
					has_tech = aa_hmg
					has_tech = range_improvements
					has_tech = survivability_studies
				}
			}
			AND = {
				has_tech = survivability_studies
				OR = {
					has_tech = aa_hmg
					has_tech = improved_small_airframe
					has_tech = range_improvements
				}
			}
		}
	}
}
 
GER_is_super_ai_yes_air = {
	GER = { 
		NOT = { has_country_flag = LSM_endsieg_has_begun }
		is_ai = yes  
		date > 1938.1.1
		num_of_military_factories > 200
		OR = {
			NOT = { 
				any_country = { 
					has_war_with = GER
					has_deployed_air_force_size = {
						type = fighter
						size > 1999 #deplaned
					}
				}
			}
			GER = { 
				has_deployed_air_force_size = {
					type = fighter
					size > 4999 #it is a super Germany
				}
			}
		}
		OR = {
			AND = {
				has_tech = range_improvements
				has_tech = aa_hmg
				OR = {
					has_tech = improved_small_airframe
					has_tech = survivability_studies
				}
			}
			AND = {
				has_tech = aa_hmg
				has_tech = improved_small_airframe
				OR = {
					has_tech = range_improvements
					has_tech = survivability_studies
				}
			}
			AND = {
				has_tech = improved_small_airframe
				has_tech = survivability_studies
				OR = {
					has_tech = aa_hmg
					has_tech = range_improvements
				}
			}
			AND = {
				has_tech = survivability_studies
				has_tech = range_improvements
				OR = {
					has_tech = aa_hmg
					has_tech = improved_small_airframe
				}
			}
		}
	}
}

GER_is_super_ai_no_air = {

	GER = { 
		is_ai = yes 
		date > 1938.1.1 
		num_of_military_factories > 200
		NOT = {
			OR = {
				AND = {
					has_tech = range_improvements
					OR = {
						has_tech = aa_hmg
						has_tech = improved_small_airframe
						has_tech = survivability_studies
					}
				}
				AND = {
					has_tech = aa_hmg
					OR = {
						has_tech = range_improvements
						has_tech = improved_small_airframe
						has_tech = survivability_studies
					}
				}
				AND = {
					has_tech = improved_small_airframe
					OR = {
						has_tech = aa_hmg
						has_tech = range_improvements
						has_tech = survivability_studies
					}
				}
				AND = {
					has_tech = survivability_studies
					OR = {
						has_tech = aa_hmg
						has_tech = improved_small_airframe
						has_tech = range_improvements
					}
				}
			}
		}
	}
} 

GER_is_human_no_air = {

	GER = { 
		is_ai = no 
		date > 1938.1.1 
		NOT = {
			OR = {
				AND = {
					has_tech = range_improvements
					OR = {
						has_tech = aa_hmg
						has_tech = improved_small_airframe
						has_tech = survivability_studies
					}
				}
				AND = {
					has_tech = aa_hmg
					OR = {
						has_tech = range_improvements
						has_tech = improved_small_airframe
						has_tech = survivability_studies
					}
				}
				AND = {
					has_tech = improved_small_airframe
					OR = {
						has_tech = aa_hmg
						has_tech = range_improvements
						has_tech = survivability_studies
					}
				}
				AND = {
					has_tech = survivability_studies
					OR = {
						has_tech = aa_hmg
						has_tech = improved_small_airframe
						has_tech = range_improvements
					}
				}
			}
		}
	}

}

any_major_is_human_has_tank = {
	
}

any_minor_is_human_has_air = {

}

any_major_is_human = {
	OR = { 
		any_country = {
			is_major = yes
			is_ai = no
		}
		NEP = { is_ai = no }
	}
}

SOV_is_deplaned = {
	AND = {
		num_of_military_factories < 300
		surrender_progress > 0.2
	}
	OR = {
		AND = {
			SOV = {
				has_war = yes
				has_deployed_air_force_size = {
					type = fighter
					size < 500 #deplaned
				}
			}
			any_country = {
				AND = {
					has_war_with = SOV
					is_major = yes
				}
				has_deployed_air_force_size = {
					type = fighter
					size > 1999 #deplaned
				}	
			}
		}
		AND = {
			SOV = {
				has_war = yes
				has_deployed_air_force_size = {
					type = fighter
					size < 1000 #deplaned
				}
			}
			any_country = {
				AND = {
					has_war_with = SOV
					is_major = yes
				}
				has_deployed_air_force_size = {
					type = fighter
					size > 3999 #deplaned
				}	
			}
		}
		has_global_flag = SOV_is_deplaned_forced_check
		has_global_flag = SOV_no_air
	}
}

GER_is_deplaned = {
	AND = {
		GER = {
			has_war = yes
			has_deployed_air_force_size = {
				type = fighter
				size < 2000 #deplaned
			}
		}
		any_country = {
			AND = {
				has_war_with = GER
				is_major = yes
			}
			has_deployed_air_force_size = {
				type = fighter
				size > 4999
			}
		}
	}
}

GER_is_not_relevant_to_allies = {
	OR = {
		GER = { has_manpower < 50000 }
		GER = { is_subject = yes }
		GER = { has_capitulated = yes }
		GER = { is_in_faction_with = ENG }
		NOT = { country_exists = GER }
		GER = { has_country_flag = lsm_eligibility_nation }
		GER = { has_country_flag = LSM_endsieg_has_begun } 
		AND = {
			OR = {
				AND = {
					GER = { surrender_progress > 0 }
					any_country = {
						original_tag = FRA
						tag = VIC
						is_in_faction_with = GER
						surrender_progress > 0.3
					}
					any_country = {
						original_tag = ITA
						is_in_faction_with = GER
						surrender_progress > 0.3
					}
				}
				any_country = {
					original_tag = FRA
					tag = VIC
					is_in_faction_with = GER
					surrender_progress > 0.6
				}
			}
			has_global_flag = d_day_happened
			has_global_flag = d_day_was_a_success
		}
	}
}

GER_is_not_relevant = {
	OR = {
		GER_is_deplaned = yes
		GER = { has_manpower < 100000 }
		GER = { is_subject = yes }
		GER = { has_capitulated = yes }
		GER = { is_in_faction_with = SOV }
		NOT = { country_exists = GER }
		GER = { has_country_flag = lsm_eligibility_nation }
		GER = { has_country_flag = LSM_endsieg_has_begun } #you are dying anyway
		AND = {
			OR = {
				AND = {
					GER = { surrender_progress > 0 }
					any_country = {
						original_tag = FRA
						is_in_faction_with = GER
						surrender_progress > 0.3
					}
					any_country = {
						original_tag = ITA
						is_in_faction_with = GER
						surrender_progress > 0.3
					}
				}
				any_country = {
					original_tag = FRA
					is_in_faction_with = GER
					surrender_progress > 0.6
				}
			}
			has_global_flag = d_day_happened
			has_global_flag = d_day_was_a_success
		}
	}
}

barbarossa_has_stalled = {
	SOV = {
		has_country_flag = {
			flag = days_since_last_change_on_the_map
			days > 30
		}
	}
}

human_is_observer = { 
	OR = {
		NEP = { is_ai = no }
		BHU = { is_ai = no }
	}
}

is_ai_tech_slave = { #reserved for very high specific, high end techs, these nations are functionally useless so they only research
	OR = {
		original_tag = TAN
		original_tag = MON
		original_tag = MEN
		original_tag = MAL
		original_tag = PHI
		original_tag = VEN
		original_tag = ALB
		original_tag = LBA
		original_tag = LUX
	}
}

is_cavalry_nation = {
	OR = {
		original_tag = MON
		original_tag = TAN
		original_tag = MEN
		original_tag = MAN
		original_tag = SIK
		original_tag = XSM
	}
	has_global_flag = cavalry_is_balanced
}

any_allied_major_is_human = {
	any_country = {
		is_allied_ai = yes
		is_ai = no
	}
}

any_axis_major_is_human = {
	any_country = {
		is_axis_ai = yes
		is_ai = no
	}
}
is_ai_mountaineer = {
	has_tech = tech_mountaineers
	OR = {
		original_tag = ITA
		original_tag = JAP
		original_tag = NEP
		original_tag = BHU
		original_tag = TIB
		original_tag = PER
		original_tag = PRU
		original_tag = ECU
		original_tag = VEN
		original_tag = COL
		original_tag = BOL
		original_tag = AFG
		original_tag = CHL
		original_tag = ARG
		original_tag = MEX
		original_tag = ROM
		original_tag = YUG
		original_tag = BUL
		original_tag = TUR
		original_tag = SPR
		original_tag = SWI
		original_tag = VIN
	}
}
is_ai_mountaineer_only = {
	has_tech = tech_mountaineers
	OR = {
		original_tag = NEP
	}
}
is_ai_marine = {
	OR = {
		has_country_flag = mobile_marine
		original_tag = USA
		original_tag = URG
		original_tag = ENG
		original_tag = AST
		original_tag = BRA
		original_tag = GER
		original_tag = POR
	}
}

is_ai_mobile_marine = {
	has_country_flag = mobile_marine
	OR = {
		original_tag = CAN
		original_tag = IRE
		original_tag = ROM
		original_tag = SWE
		original_tag = AST
	}
}


might_need_to_have_aggro = {
	OR = {
		original_tag = AOI
		AND = {
			is_historical_focus_on = no
			is_in_faction = yes
			NOT = {
				any_enemy_country = { is_ai = no }
			}
		}
		AND = {
			NOT = { surrender_progress > 0 }
			is_in_faction = no
		}
	}
}
is_ai_mass_mob_ex = { 
	OR = {
		original_tag = MON
		original_tag = AFG
		original_tag = TAN
	}	
}
is_ai_mass_mob = {  
	NOT = { has_country_flag = mobile_marine }
	OR = {
		has_country_flag = mass_mob_minor
		difficulty > 1
	}
	OR = {
		has_country_flag = mass_mob_minor
		AND = {
			is_major = no
			has_tech = mass_assault
			is_historical_focus_on = no
		}
		is_historical_focus_on = yes
	}
	OR = {
		AND = {
			is_major = no
			has_tech = mass_assault
			is_historical_focus_on = no
		}
		has_country_flag = mass_mob_minor
		original_tag = LBA
		original_tag = ALB
		original_tag = AOI
		original_tag = HUN
		original_tag = IRE
		original_tag = POL
		original_tag = TUR
		original_tag = SAF
		original_tag = RAJ
		original_tag = ROM
		original_tag = VIN
		original_tag = MEX
		original_tag = YUG
		original_tag = HOL
		original_tag = BEL
		original_tag = GRE
		original_tag = SLO
		original_tag = FIN
		original_tag = MNT
		original_tag = NOR
		original_tag = DEN
		original_tag = ALB
		original_tag = BUL
		original_tag = PHI
		original_tag = LIT
		original_tag = LAT
		original_tag = EST
		original_tag = SWI
		original_tag = MAN
		original_tag = MEN
		original_tag = SIA
		original_tag = SPR
		AND = {
			original_tag = ARG
			OR = {
				is_historical_focus_on = no
				NOT = { has_dlc = "Trial of Allegiance" }
			}
		}
		AND = {
			original_tag = BRA
			OR = {
				is_historical_focus_on = no
				NOT = { has_dlc = "Trial of Allegiance" }
			}
		}
		AND = {	
			original_tag = ITA
			surrender_progress > 0.1 #time to act like who we truly are 
		}
		AND = { 
			original_tag = FRA
			has_focus_tree = vichy_french_focus
		}
		AND = { 
			OR = {
				original_tag = AST
				original_tag = MAL
				original_tag = CAN
			}
			ENG = { is_ai = yes }
		}
	}
}
is_ai_mass_mob_copy = { 
	OR = {
		has_country_flag = mass_mob_minor
		AND = {
			is_major = no
			has_tech = mass_assault
			is_historical_focus_on = no
		}
		is_historical_focus_on = yes
	}
	OR = {
		AND = {
			is_major = no
			has_tech = mass_assault
			is_historical_focus_on = no
		}
		has_country_flag = mass_mob_minor
		original_tag = ROM
		original_tag = LBA
		original_tag = ALB
		original_tag = HUN
		original_tag = POL
		original_tag = TUR
		original_tag = SAF
		original_tag = RAJ
		original_tag = ROM
		original_tag = MEX
		original_tag = YUG
		original_tag = HOL
		original_tag = BEL
		original_tag = IRE
		original_tag = GRE
		original_tag = SLO
		original_tag = FIN
		original_tag = MNT
		original_tag = NOR
		original_tag = DEN
		original_tag = ALB
		original_tag = BUL
		original_tag = PHI
		original_tag = LIT
		original_tag = LAT
		original_tag = EST
		original_tag = SWI
		original_tag = MAN
		original_tag = MEN
		original_tag = SIA
		original_tag = SPR
		AND = {
			original_tag = ARG
			OR = {
				is_historical_focus_on = no
				NOT = { has_dlc = "Trial of Allegiance" }
			}
		}
		AND = {
			original_tag = BRA
			OR = {
				is_historical_focus_on = no
				NOT = { has_dlc = "Trial of Allegiance" }
			}
		}
		AND = {	
			original_tag = ITA
			surrender_progress > 0.1 #time to act like who we truly are 
		}
		AND = { 
			original_tag = FRA
			has_focus_tree = vichy_french_focus
		}
		AND = { 
			OR = {
				original_tag = AST
				original_tag = MAL
				original_tag = CAN
			}
			ENG = { is_ai = yes }
		}
	}
}


is_ai_mech_mob = { 
	OR = {
		AND = {
			original_tag = ARG
			has_dlc = "Trial of Allegiance"
			is_historical_focus_on = yes
		}
		AND = {
			original_tag = BRA
			has_dlc = "Trial of Allegiance"
			is_historical_focus_on = yes
		}
		AND = {
			original_tag = URG
			has_dlc = "Trial of Allegiance"
			is_historical_focus_on = yes
		}
		AND = {
			original_tag = CHL
			has_dlc = "Trial of Allegiance"
			is_historical_focus_on = yes
		}
	}
}

is_ai_tank_minor = { 
	original_tag = DNZ
}

is_ai_navy = { 
	OR = {
		AND = {
			has_war = yes
			original_tag = ITA
		}
		original_tag = JAP
		original_tag = ENG
		original_tag = USA
		has_idea = crossing_the_atlantic_idea
		has_idea = crossing_the_pacific_idea
	}
}

is_ai_armored_car = { 
	OR = {
		original_tag = SWE
	}
}

is_ai_airforce = { 
	OR = {
		original_tag = ITA
		AND = {
			original_tag = FRA
			NOT = { has_global_flag = vanilla_history }
		}
		original_tag = JAP
		original_tag = ENG
		original_tag = USA
		original_tag = GER
		original_tag = BUL
		original_tag = SOV
		original_tag = CAN
		original_tag = BRA
		original_tag = ARG
		original_tag = CHL
		original_tag = DEN
		original_tag = ROM
	} 
	is_historical_focus_on = yes
}
is_axis_ai = {
	OR = {
		original_tag = ROM
		original_tag = HUN
		original_tag = BUL
		original_tag = ITA
		original_tag = SIA
		original_tag = GER
		original_tag = SLO
		original_tag = JAP
		original_tag = MAN
		original_tag = MEN
		AND = {
			OR = {
				original_tag = DEN #added for puppetry
				original_tag = SWE #added for neutrality
				original_tag = POR #added for neutrality
				original_tag = SPR #added for neutrality
				original_tag = NOR
			}
			is_in_faction_with = GER
		}
		original_tag = ALB
		original_tag = MNT
		original_tag = LBA
		original_tag = AUS
		original_tag = AOI
		original_tag = LBA
		original_tag = VEN
	}
	NOT = { has_government = democratic }
	NOT = { has_government = communism }
	is_historical_focus_on = yes
}

is_allied_ai = { 
	OR = {
		original_tag = FRA
		original_tag = POL
		original_tag = ENG
		original_tag = USA
		original_tag = RAJ
		original_tag = CAN
		original_tag = SAF
		original_tag = HOL
		original_tag = BEL
		original_tag = LUX
		original_tag = AST
		original_tag = MAL
		original_tag = NZL
		original_tag = SOV
		original_tag = MON
		original_tag = TAN
		original_tag = BRA
		original_tag = MEX
		original_tag = YUG
		original_tag = GRE
		original_tag = TUR
		original_tag = CZE
		original_tag = MAL
		original_tag = ARG
		original_tag = CHL
		original_tag = URG
		AND = {
			original_tag = SWE
			is_ai = yes
			has_government = democratic 
		}
	}
	NOT = { has_government = fascism }
	is_historical_focus_on = yes
}

is_dominantly_land_combat_country = { 
	OR = {
		original_tag = FIN
		original_tag = POL
		original_tag = HUN
		original_tag = ROM
		original_tag = BUL
		original_tag = YUG
		original_tag = SWI
		is_literally_china = yes
		original_tag = TIB
		original_tag = BHU
		original_tag = NEP
		original_tag = PER
		original_tag = AFG
		original_tag = LIT
		original_tag = LAT
		original_tag = EST	
	}
	NOT = {	has_tech = improved_small_airframe }
	NOT = {	is_researching_technology = improved_small_airframe }
	NOT = {	is_researching_technology = basic_small_airframe }
}

not_a_good_time_for_counterattack = {
	SOV = {
		OR = {
			has_country_flag = {
				flag = days_since_last_change_on_the_map
				days < 6 #we are being pushed back
			}
			has_idea = last_offensive_was_not_good
		}
	}
	NOT = {
		OR = {
			GER_is_not_relevant = yes
			AND = {
				has_global_flag = d_day_happened
				OR = { 
					GER = { check_variable = { GER_blitzkrieg < 10 } }
					ITA = { has_civil_war = yes }
					16 = { controller = { has_war_with = GER } }
				}
			}
		}
	}
}

FRA_1936_election_criteria = {
	OR = {
		any_other_country = {
			is_major = yes
			is_ai = no
			NOT = { has_government = democratic }
		}
	}
}

human_is_bombing_us_without_attacking = {
	SOV = { 
		OR = {
			NOT = { has_country_flag = days_since_last_change_on_the_map } 
			has_country_flag = {
				flag = days_since_last_change_on_the_map
				days > 90
			}
		}
	}
}
ENG_always_worry_invasion_condition_1 = {
	ROOT = {
		OR = {
			AND = {
				NOT = { tag = FRA }
				NOT = { tag = HOL }
				NOT = { tag = BEL }
				OR = {
					NOT = { tag = ETH }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = SAF }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = AST }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = RAJ }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = MAL }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
			}
			has_capitulated = yes
			has_global_flag = vanilla_history
			AND = {
				tag = FRA
				surrender_progress > 0.3 #time to flee
			}
		}
		OR = {
			NOT = { tag = ENG }
			FRA = { has_capitulated = yes }
			FRA = { surrender_progress > 0.5 }
			NOT = { FRA = { is_in_faction_with = ENG } }
		}
		is_in_faction_with = ENG
		OR = {
			AND = {
				NOT = { GER = { has_war_with = SOV } }
				country_exists = SOV
			}
			NOT = { country_exists = SOV }
			NOT = {
				any_country = {
					is_in_faction_with = ENG
					num_of_military_factories > 150
					OR = {
						NOT = { capital_scope = { is_on_continent = europe } }
						NOT = { surrender_progress > 0 }
					}
				}
			}
		}
		OR = {
			AND = {
				GER = { is_ai = no }
				NOT = { GER = { is_in_faction_with = ENG } }
			}
			AND = {
				ITA = { is_ai = no }
				NOT = { ITA = { is_in_faction_with = ENG } }
			}
			AND = {
				JAP = { is_ai = no }
				NOT = { JAP = { is_in_faction_with = ENG } }
				any_state = {
					is_on_continent = europe
					JAP = { divisions_in_state = { state = PREV size > 0 } }
				}
			}
			any_country = {
				has_war_with = ENG
				is_ai = no
				OR = {
					is_major = yes
					has_tech = paratroopers
				}
			}
			PAN = { is_ai = no }
		}
		ENG = { surrender_progress < 0.02 }
		OR = {
			FRA = { has_capitulated = yes }
			FRA = { surrender_progress > 0.5 }
			NOT = { FRA = { is_in_faction_with = ENG } }
			has_war_with = FRA
		}
		GER_is_not_relevant_to_allies = no
		FRA = { is_ai = yes }
		NOT = {
			OR = {
				has_idea = d_day_preparation_1 
				has_idea = d_day_preparation_2
				has_idea = d_day_preparation_3
			}
		} 
	}
}
ENG_always_worry_invasion_condition_2 = {
		any_country = { 
			OR = {
				is_major = yes
				AND = {
					is_in_faction = yes
					has_tech = paratroopers
				}
			}
			OR = {
				has_war_with = ENG
				NOT = { has_government = democratic }
			}
			NOT = { is_in_faction_with = ENG }
			OR = {
				is_major = yes
				is_in_faction = yes
			}
			is_ai = no
		}
		NOT = {
			OR = {
				has_idea = d_day_preparation_1 
				has_idea = d_day_preparation_2
				has_idea = d_day_preparation_3
			}
		}
}
world_war_is_active = {
	OR = {
		any_country = {
			has_war = yes
			num_of_military_factories > 200
			any_enemy_country = {
				num_of_military_factories > 200
			}
		}
		count_triggers = {
			amount = 2
			any_country = {
				is_major = yes
				OR = {
					any_other_country = {
						is_in_faction_with = PREV
						is_major = yes
					}
					num_of_military_factories > 200
				}
				has_war_with = ENG
			}
			any_country = {
				is_major = yes
				OR = {
					any_other_country = {
						is_in_faction_with = PREV
						is_major = yes
					}
					num_of_military_factories > 200
				}
				has_war_with = FRA
			}
			any_country = {
				is_major = yes
				OR = {
					any_other_country = {
						is_in_faction_with = PREV
						is_major = yes
					}
					num_of_military_factories > 200
				}
				has_war_with = GER
			}
			any_country = {
				is_major = yes
				OR = {
					any_other_country = {
						is_in_faction_with = PREV
						is_major = yes
					}
					num_of_military_factories > 200
				}
				has_war_with = ITA
			}
			any_country = {
				is_major = yes
				OR = {
					any_other_country = {
						is_in_faction_with = PREV
						is_major = yes
					}
					num_of_military_factories > 200
				}
				has_war_with = SOV
			}
			any_country = {
				is_major = yes
				OR = {
					any_other_country = {
						is_in_faction_with = PREV
						is_major = yes
					}
					num_of_military_factories > 200
				}
				has_war_with = USA
			}
			any_country = {
				is_major = yes
				OR = {
					any_other_country = {
						is_in_faction_with = PREV
						is_major = yes
					}
					num_of_military_factories > 200
				}
				has_war_with = JAP
			}
		}
	}
}

JAP_maybe_we_should_hold = { #to fk Axis players maybe
	NOT = { has_global_flag = mp_difficulty }
	OR = {
		GER = { is_ai = no }
		ITA = { is_ai = no }
	}
	CHI = { surrender_progress < 0.8 }
	date > 1940.6.1
}