ERE_upgrade_from_interwartanks_asap = {
	allowed = {
		original_tag = ERE
	}
	enable = {
		is_historical_focus_on = yes
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = medium_tank_chassis_1
		value = 100  # 100 essentially means we don't require a stockpile surplus
	}
	ai_strategy = {
		type = production_upgrade_desire_offset
		id = medium_tank_equipment_1
		value = 100  # 100 essentially means we don't require a stockpile surplus
	}
}


ERE_less_weapons_more_construction = {
	allowed = {
		original_tag = ERE
	}
	enable = {
		date < 1939.1.1
		has_war = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_market_spend_factories
		value = -80  # 80 % less factories
	}
	ai_strategy = {  # Don't even try buying infantry equipment too early
		type = equipment_market_buying_threshold
		id = infantry_equipment
		value = -20000  # Absolute number of units
	}
}

ERE_fewer_factories_for_purchases = {
	allowed = {
		original_tag = ERE
	}
	enable = {
		date > 1939.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_market_spend_factories
		value = -50  # 50 % less factories
	}
}


EEW_royal_air_force = {
	allowed = { original_tag = EEW }
	enable = {
		date > 1939.4.1
	}
	abort = {
		date < 1939.4.1
	}

	ai_strategy = {
		type = air_factory_balance
		value = 50
	}
}


ERE_accept_USA_access = {
	allowed = {
		original_tag = ERE
	}
	enable = {
		tag = ERE
		date > 1940.9.9
		LSA = {
			is_ai = yes
			NOT = {
				OR = {
					is_in_faction_with = ERE
					has_military_access_to = ERE
				}
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = diplo_action_acceptance
		id = LSA
		target = military_access
		value = 1000
	}
}

ERE_dont_get_sucked_into_WRE_and_die = {

	enable = {
		OR = {
			tag = ERE
			is_subject_of = ERE
		}
		has_war_with = GEM
		has_war_together_with = WRE

		date < 1941.9.9
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		area = italy
		value = -60
	}

	ai_strategy = {
  		type = garrison
   		value = 100
   	}

	ai_strategy = {
    type = garrison_reinforcement_priority
    value = 100
}

}



ERE_if_the_best_arrangements_are_made_as_they_are_being_made = {
	allowed = {
		original_tag = ERE
	}
	enable = {
		date > 1940.1.1
		has_war_with = GEM
		num_of_military_factories < 150
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = added_military_to_civilian_factory_ratio
		value = 50
	}

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

ERE_the_best_arrangements_are_made = {
	allowed = {
		original_tag = ERE
	}
	enable = {
		date > 1940.1.1
		has_war_with = GEM
		num_of_military_factories > 150
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = added_military_to_civilian_factory_ratio
		value = 20
	}
}


ERE_defend_mediterranean = {
	allowed = {
		tag = ERE
	}

	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

	# Alexandria
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 447
		value = 10
	}

	# Gibraltar
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 118
		value = 4
	}

	# Malta
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 116
		value = 4
	}
}


ENG_super_boost_armor_div = { #lets make sure the uk upgrades rtr to divs
	allowed = {
		original_tag = ERE
	}
	enable = {
		OR = {
			has_tech = basic_medium_tank
			has_tech = basic_medium_tank_chassis
		}
		NOT = { has_template_ai_majority_unit = medium_armor }
		has_war = no
		date > 1937.1.1

	}

	abort = {
		has_template_ai_majority_unit = medium_armor
		date > 1940.1.1
	}

	# lets do changes more often during this period too
	ai_strategy = {
		type = land_xp_spend_priority
		id = division_template
		value = 100
	}

	# this is gateway
	ai_strategy = {
		type = template_prio
		id = light_armor
		value = 100
	}
}

ERE_super_boost_armor_div_med = { #lets make sure the uk upgrades armor divs to mediums
	allowed = {
		original_tag = ERE
	}
	enable = {
		OR = {
			has_tech = basic_medium_tank
			has_tech = basic_medium_tank_chassis
		}
		NOT = { has_template_ai_majority_unit = medium_armor }

		date > 1940.1.1
	}

	abort = {
		has_template_ai_majority_unit = medium_armor
	}

	# lets do changes more often during this period too
	ai_strategy = {
		type = land_xp_spend_priority
		id = division_template
		value = 100
	}

	# this is gateway
	ai_strategy = {
		type = template_prio
		id = light_armor
		value = 100
	}

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

	ai_strategy = {
		type = template_prio
		id = motorized
		value = 200
	}
}

ERE_LSA_take_italys_spaghetti = {
	allowed = {
		OR = {
			original_tag = ERE
			original_tag = LSA
		}
		is_historical_focus_on = yes
	}
	enable = {
		date > 1942.6.1
		ITA = {
			surrender_progress < 0.2
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = italy
		value = 60
	}

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

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


ERE_LSA_onto_the_beaches_3 = {
	allowed = {
		OR = {
			original_tag = LSA
			original_tag = ERE
		}
		is_historical_focus_on = yes
	}
	enable = {
		date > 1943.6.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 30
	}
}

ERE_LSA_onto_the_beaches_4 = {
	allowed = {
		OR = {
			original_tag = LSA
			original_tag = ERE
		}
		is_historical_focus_on = yes
	}
	enable = {
		date > 1944.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 20
	}
}


ERE_we_hate_fighting_in_the_balkans = {

	enable = {
		date < 1941.1.1
		is_in_faction_with = ERE
		NOT = { tag = WRE }
		NOT = { tag = NLL }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		area = greater_balkans
		value = -100
	}

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

WRE_sardinia_is_a_stupid_island = {

	allowed = {
		original_tag = WRE
	}
	enable = {
		date < 1943.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		area = sardinia
		value = -50
	}

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

	ai_strategy = {
		type = invasion_unit_request
		area = sardinia
		value = -100
	}
}

ERE_i_dont_like_western_romans = {
	enable = {
        original_tag = ERE

		GEM = { has_war_with = WRE }
		WRE = {
			OR = {
				exists = yes
				has_capitulated = no
			}
		}

		date < 1941.1.1
	}

	abort = {
		OR = {
			NOT = { GEM = { has_war_with = WRE } }
			WRE = {
				OR = {
					exists = no
					has_capitulated = yes
				}
			}
			date > 1941.1.1
		}
	}

	ai_strategy = {
		type = invade
		id = GEM
		value = -2000
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		id = WRE
		value = 100
	}
}

ERE_prepare_against_west_rome = {
	allowed = {
		original_tag = ERE
	}
	enable = {
		focus_progress = {
			focus = WRE_the_belgrade_incident
			progress > 0.1
		}
		country_exists = WRE

	}

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

	ai_strategy = {
		type = force_concentration_front_factor
		tag = WRE
		value = 200
	}
}
