GER_plane_boost  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_equipment = { medium_tank_chassis > 15000 }
		any_country = {
			is_allied_ai = yes
			is_ai = no
		}
	}

	abort = {
		has_equipment = { medium_tank_chassis < 10000 }

	}

	ai_strategy = {
		type = air_factory_balance
		value = 25
	}

}

GER_plane_boost_2  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_equipment = { medium_tank_chassis > 25000 }
		any_country = {
			is_allied_ai = yes
			is_ai = no
		}
	}

	abort = {
		has_equipment = { medium_tank_chassis < 20000 }

	}

	ai_strategy = {
		type = air_factory_balance
		value = 25
	}

}
GER_do_not_help_at_ITA_alpine = {
	enable = {
		NOT = { tag = ITA }
		NOT = { is_subject_of = ITA }
		is_historical_focus_on = yes
		is_in_faction_with = ITA
		NOT = { ITA = { surrender_progress > 0.1 } }
		158 = { is_fully_controlled_by = ITA }
		OR = {
			735 = { is_controlled_by = FRA }
			851 = { is_controlled_by = FRA }
		}
		FRA = {
			NOT = { has_country_flag = LSM_eligibility_nation }
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		state = 735
		value = -75
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "ITA"
		value = 100
	}
}

sardegna_is_a_trap  = {
	allowed = {
		is_axis_ai = yes
		NOT = { tag = ITA }
	}

	enable = {
		is_historical_focus_on = yes
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		state = 114
		value = -500 # lets put more units, should be safe
	}

	ai_strategy = {
		type = front_unit_request
		area = sardinia
		value = -100 # lets put more units, should be safe
	}

	ai_strategy = {
		type = area_priority
		id = sardinia
		value = -100
	}
}

GER_barbarossa_airwar_won = {
	allowed = {
		original_tag = GER
	}
	enable = {
		SOV_is_deplaned = yes
		has_war_with = SOV
		NOT = { has_global_flag = d_day_happened }
		has_deployed_air_force_size = {
			size < 2999 
			type = cas
		}
	}
	abort_when_not_enabled = yes

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

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

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

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

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

 	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 25 #we control the sky sooooo...
	}

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

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

GER_europe_is_our_priority  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		OR = {
			AND = {
				has_war_with = FRA
				FRA = { has_capitulated = no }
			}
			focus_progress = {
				focus = GER_danzig_or_war
				progress > 0
			}
			has_completed_focus = GER_danzig_or_war
		}
		OR = {
			NOT = { is_in_faction_with = SOV }
			has_war_with = SOV
			NOT = { has_idea = GER_SOV_hitler_stalin_pact }
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "AOI"
		value = 100
	}
	
	ai_strategy = {
		type = area_priority
		id = europe
		value = 200
	}
	
	ai_strategy = {
		type = area_priority
		id = africa
		value = -200
	}

}

GER_panzer_against_poland  = { #extra score here
	allowed = {
		original_tag = GER
	}

	enable = {
		OR = {
			focus_progress = {
				focus = GER_danzig_or_war
				progress > 0
			}
			has_completed_focus = GER_danzig_or_war
		}
		OR = {
			NOT = { has_war_with = POL }
			AND = {
				has_war_with = POL
				POL = { has_capitulated = no }
			}
		}
		10 = { controller = { tag = POL } }
		country_exists = POL
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_armor_score
		id = "FRA"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "ITA"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "AOI"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "POL"
		value = 500
	}

}

GER_fight_SOV  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		NOT = { has_war_with = SOV }
		has_wargoal_against = SOV
		NOT = { surrender_progress > 0 }
	}

	abort_when_not_enabled = yes

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

}

GER_dont_attack_SOV  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		NOT = { has_country_flag = mass_mob_flag }
		NOT = { has_country_flag = mass_infantry_flag }
		NOT = { has_country_flag = spacemarine_gbp }
		has_war_with = SOV
		OR = {
			GER_ongoing_offensive = no
			has_equipment = { medium_tank_chassis < -500 }
		}
	}

	abort = {
		NOT = { has_country_flag = mass_mob_flag }
		NOT = { has_country_flag = mass_infantry_flag }
		AND = {
			has_equipment = { medium_tank_chassis > 1000 }
			GER_ongoing_offensive = yes
		}		
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

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

}

GER_dont_attack_SOVmm  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_country_flag = mass_mob_flag
		has_war_with = SOV
		OR = {
			AND = { 
				NOT = { has_idea = GER_barbarossa_offensive_1 } 
				NOT = { has_idea = GER_barbarossa_offensive_2 } 
				NOT = { has_idea = GER_barbarossa_offensive_3 } 
				NOT = { has_idea = GER_barbarossa_offensive_4 } 
				NOT = { has_idea = GER_barbarossa_offensive_5 }
			}
			has_equipment = { light_tank_chassis < -500 }
			has_equipment = { infantry_equipment < -10000 }
		}
	}

	abort = {
		has_country_flag = mass_mob_flag
		AND = {
			has_equipment = { light_tank_chassis > 1000 }
			has_equipment = { infantry_equipment > 10000 }
			OR = {
				has_idea = GER_barbarossa_offensive_1 
				has_idea = GER_barbarossa_offensive_2 
				has_idea = GER_barbarossa_offensive_3
				has_idea = GER_barbarossa_offensive_4 
				has_idea = GER_barbarossa_offensive_5
			}
		}		
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

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

}
GER_dont_attack_SOVsg  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_country_flag = spacemarine_gbp
		has_war_with = SOV
		OR = {
			GER_ongoing_offensive = no
			has_equipment = { heavy_tank_destroyer_chassis < -300 }
			has_equipment = { infantry_equipment < -10000 }
		}
	}

	abort = {
		AND = {
			has_equipment = { heavy_tank_destroyer_chassis > 500 }
			has_equipment = { infantry_equipment > 20000 }
			GER_ongoing_offensive = yes
		}		
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

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

}

GER_attack_SOVmm  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_country_flag = mass_mob_flag
		has_war_with = SOV
		AND = {
			OR = {
				has_idea = GER_barbarossa_offensive_1 
				has_idea = GER_barbarossa_offensive_2 
				has_idea = GER_barbarossa_offensive_3 
				has_idea = GER_barbarossa_offensive_4 
				has_idea = GER_barbarossa_offensive_5
			}
			has_equipment = { light_tank_chassis > 1000 }
			has_equipment = { infantry_equipment > 10000 }
		}
	}

	abort = {
		OR = {
			has_equipment = { medium_tank_chassis < -500 }
			has_equipment = { infantry_equipment < -10000 }
			AND = { 
				NOT = { has_idea = GER_barbarossa_offensive_1 } 
				NOT = { has_idea = GER_barbarossa_offensive_2 } 
				NOT = { has_idea = GER_barbarossa_offensive_3 } 
				NOT = { has_idea = GER_barbarossa_offensive_4 } 
				NOT = { has_idea = GER_barbarossa_offensive_5 }
			}
		}
	}

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

		priority = 100
		ordertype = front
		execution_type = balanced
		execute_order = yes
	}

}

GER_dont_attack_SOVmi  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_country_flag = mass_infantry_flag
		has_war_with = SOV
		OR = {
			AND = { 
				NOT = { has_idea = GER_barbarossa_offensive_1 } 
				NOT = { has_idea = GER_barbarossa_offensive_2 } 
				NOT = { has_idea = GER_barbarossa_offensive_3 } 
				NOT = { has_idea = GER_barbarossa_offensive_4 } 
				NOT = { has_idea = GER_barbarossa_offensive_5 }
			}
			has_equipment = { infantry_equipment < 30000 }
		}
	}

	abort = {
		AND = {
			has_equipment = { infantry_equipment > 30000 }
			OR = {
				has_idea = GER_barbarossa_offensive_1 
				has_idea = GER_barbarossa_offensive_2 
				has_idea = GER_barbarossa_offensive_3
				has_idea = GER_barbarossa_offensive_4 
				has_idea = GER_barbarossa_offensive_5
			}
		}		
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

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

}

GER_attack_SOVmi  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_country_flag = mass_infantry_flag
		has_war_with = SOV
		AND = {
			OR = {
				has_idea = GER_barbarossa_offensive_1 
				has_idea = GER_barbarossa_offensive_2 
				has_idea = GER_barbarossa_offensive_3 
				has_idea = GER_barbarossa_offensive_4 
				has_idea = GER_barbarossa_offensive_5
			}
			has_equipment = { infantry_equipment > 30000 }
		}
	}

	abort = {
		OR = {
			has_equipment = { infantry_equipment < 10000 }
			AND = { 
				NOT = { has_idea = GER_barbarossa_offensive_1 } 
				NOT = { has_idea = GER_barbarossa_offensive_2 } 
				NOT = { has_idea = GER_barbarossa_offensive_3 } 
				NOT = { has_idea = GER_barbarossa_offensive_4 } 
				NOT = { has_idea = GER_barbarossa_offensive_5 }
			}
		}
	}

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

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

}
GER_attack_SOV  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
			has_equipment = { medium_tank_chassis > 1000 }
			OR = {
				has_equipment = { medium_tank_chassis < 10000 }
				has_equipment = { infantry_equipment < 50000 }
			}
			has_war_with = SOV
			NOT = { has_country_flag = spacemarine }
			NOT = { has_country_flag = spacemarine_gbp }
			NOT = { has_country_flag = mech_god }
			NOT = { has_country_flag = mass_mob_flag }
			NOT = { has_country_flag = mass_infantry_flag }
			AND = {
				GER_ongoing_offensive = yes
				has_equipment = { medium_tank_chassis > 1000 }
			}
	}

	abort = {
		OR = {
			has_equipment = { medium_tank_chassis < -500 }
			GER_ongoing_offensive = no
		}
	}

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.0

		priority = 100
		ordertype = front
		execution_type = balanced
		execute_order = yes
	}

}
GER_attack_SOV_spacemarine  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = SOV
		has_country_flag = spacemarine
		OR = {
			AND = {
				GER_ongoing_offensive = yes
				has_equipment = { infantry_equipment > 20000 }
				has_equipment = { medium_tank_chassis > 2000 }
			}
			has_idea = blitzkrieg_on_a_roll
		}
	}

	abort = {
		OR = { 
			has_equipment = { infantry_equipment < -10000 }
			has_equipment = { medium_tank_chassis < -500 }
			GER_ongoing_offensive = no
		}
		NOT = { has_idea = blitzkrieg_on_a_roll }
	}

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

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

}
GER_attack_SOV_spacemarine_gbp  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = SOV
		has_country_flag = spacemarine_gbp
		OR = {
			AND = {
				GER_ongoing_offensive = yes
				has_equipment = { infantry_equipment > 20000 }
				has_equipment = { heavy_tank_destroyer_chassis > 500 }
			}
			has_idea = blitzkrieg_on_a_roll
		}
	}

	abort = {
		OR = { 
			has_equipment = { infantry_equipment < -10000 }
			has_equipment = { heavy_tank_destroyer_chassis < -300 }
			GER_ongoing_offensive = no
		}
		NOT = { has_idea = blitzkrieg_on_a_roll }
	}

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

}
GER_attack_SOV_mech  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = SOV
		has_country_flag = mech_god
		OR = {
			AND = {
				GER_ongoing_offensive = yes
				has_equipment = { mechanized_equipment > 1000 }
			}
		}
	}

	abort = {
		OR = { 
			has_equipment = { mechanized_equipment < -5000 }
			GER_ongoing_offensive = no
		}
	}

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.6

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

}

GER_dont_attack_POL  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = POL
		OR = {
			GER_ongoing_offensive = no
			has_equipment = { infantry_equipment < -8000 }
		}
	}

	abort = {
		OR = {
			AND = { 
				POL = { is_ai = yes }
				has_equipment = { infantry_equipment > -1000 }
			}
			AND = { 
				POL = { is_ai = no }
				has_equipment = { infantry_equipment > 2000 }
			}
		}
	}

	ai_strategy = {
		type = front_control

		tag = POL

		ratio = 0.4

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

}
GER_dont_attack_FRA_et  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		date < 1940.3.1
		FRA = { has_capitulated = no }
		has_war_with = FRA
		has_war_with = POL
		POL = { has_capitulated = no }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = FRA

		ratio = 0.4

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

}
GER_attack_FRA_d_day  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = FRA
		has_idea = GER_dday_counteroffensive
	}

	abort = {
		NOT = { has_idea = GER_dday_counteroffensive }
	}

	ai_strategy = {
		type = front_control

		tag = FRA

		ratio = 0.4

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

	ai_strategy = {
		type = front_armor_score
		id = "FRA"
		value = 90
	}

}

GER_dont_attack_FRA_d_day  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = FRA
		has_global_flag = d_day_happened
		NOT = { has_idea = GER_dday_counteroffensive }
	}

	abort = {
		has_idea = GER_dday_counteroffensive
	}

	ai_strategy = {
		type = front_control

		tag = FRA

		ratio = 0.4

		priority = 100
		ordertype = front
		execution_type = balanced
	}

	ai_strategy = {
		type = front_armor_score
		id = "FRA"
		value = 30
	}

	ai_strategy = {
		type = front_armor_score
		id = "SOV"
		value = 40
	}

}

GER_attack_POL  = {#lets try
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = POL
		OR = {
			has_idea = GER_barbarossa_offensive_1 
			has_idea = GER_barbarossa_offensive_2 
			has_idea = GER_barbarossa_offensive_3 
			has_idea = GER_barbarossa_offensive_4 
			has_idea = GER_barbarossa_offensive_5
		}
		OR = {
			AND = {
				POL = { is_ai = yes }
				has_equipment = { infantry_equipment > -1000 }
			}
			AND = {
				POL = { is_ai = no }
				has_equipment = { infantry_equipment > 2000 }
			}
		}
	}

	abort = {
		has_equipment = { infantry_equipment < -8000 }
	}

	ai_strategy = {
		type = front_control

		tag = POL

		ratio = 0.4

		priority = 100
		ordertype = front
		execution_type = rush
	}

}

GER_we_can_do_a_bit_more_cas_maybe = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_deployed_air_force_size = {
			type = fighter
			size > 8999
		}
	}

	abort = {
		has_deployed_air_force_size = {
			type = fighter
			size < 4999 #let's stop with CAS
		}
	}

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

GER_gun_gun_gun_research = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1937.6.1
		NOT = { has_country_flag = mobile_warfare_flag }
		NOT = { has_tech = improved_infantry_weapons }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = research_tech
		id = improved_infantry_weapons
		value = 50 #get the gun, we need the gun cuz we need stacked infantry
	}

	ai_strategy = {
		type = research_tech
		id = infantry_weapons1
		value = 50 #get the gun, we need the gun cuz we need stacked infantry
	}

	ai_strategy = {
		type = research_tech
		id = infantry_weapons2
		value = 50 #get the gun, we need the gun cuz we need stacked infantry
	}
}

GER_get_engineer1_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1937.8.1
	}

	abort = {
		has_tech = tech_engineers
	}

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

GER_get_engineer2_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1938.8.1
	}

	abort = {
		has_tech = tech_engineers2
	}

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

GER_get_engineer3_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1940.7.1
	}

	abort = {
		has_tech = tech_engineers3
	}

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

GER_get_aa_cannon_3_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1946.3.1
	}

	abort = {
		has_tech = aa_cannon_3
	}

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

GER_get_engine_3_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1939.3.1 #about time
		ITA_is_doing_it_for_us = no
	}

	abort = {
		OR = {
			has_tech = engines_3
			ITA_is_doing_it_for_us = yes
			has_country_flag = plane_licensed_ITA
		}
	}

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

GER_get_engine_4_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1943.6.1
	}

	abort = {
		has_tech = engines_4
	}

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

GER_heavy_bomb_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1939.8.1
	}

	abort = {
		has_tech = heavy_bombs
	}

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

GER_survivability_tech_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1939.1.1 #pushed up
		ITA_is_doing_it_for_us = no
	}

	abort = {
		OR = {
			has_tech = survivability_studies
			ITA_is_doing_it_for_us = yes
			has_country_flag = plane_licensed_ITA
		}
	}

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

GER_improved_small_airframe_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1939.1.1 #push up
		ITA_is_doing_it_for_us = no
	}

	abort = {
		OR = {
			has_tech = improved_small_airframe
			ITA_is_doing_it_for_us = yes
			has_country_flag = plane_licensed_ITA
		}
	}

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

GER_aa_hmg_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1938.3.1 #push up
		ITA_is_doing_it_for_us = no
	}

	abort = {
		OR = {
			has_tech = aa_hmg
			ITA_is_doing_it_for_us = yes
			has_country_flag = plane_licensed_ITA
		}
	}

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

GER_range_improvements_please = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1939.1.1 #we realised range is necessary
		ITA_is_doing_it_for_us = no
	}

	abort = {
		OR = {
			has_tech = range_improvements
			ITA_is_doing_it_for_us = yes
			has_country_flag = plane_licensed_ITA
		}
	}

	ai_strategy = {
		type = research_tech
		id = range_improvements
		value = 100
	}
}
GER_improved_medium_tank_is_necessary = {
	allowed = {
		OR = {
			original_tag = GER
			original_tag = USA
		}
	}
	enable = {
		date > 1939.1.1
		NOT = { has_tech = improved_medium_tank_chassis }
		NOT = { has_country_flag = mass_infantry_flag }
		NOT = { has_country_flag = mass_mob_flag }
		if = {
			limit = {
				tag = USA
			}
			has_completed_focus = USA_main_battle_tanks
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = research_tech
		id = improved_medium_tank_chassis
		value = 500
	}
}
