# Build infra if possible
ETH_build_infrastructure_if_possible = {

	allowed = { has_dlc = "By Blood Alone" }
	enable = {
		original_tag = ETH 
		has_idea = ETH_rebuilding_the_country_idea
	}

	abort_when_not_enabled = yes 

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 271
		value = 200
	}
}

# Don't lend lease to ETh
ETH_lon_dont_support_ethiopia_with_weapons = {

	allowed = { has_dlc = "By Blood Alone" }
	enable = {
		is_league_of_nations_member = yes 
		NOT = {
			tag = ETH
		}
	}

	abort = {
		OR = {
			NOT = { has_global_flag = second_italo_ethiopian_war_flag }
			ETH = { has_completed_focus = ETH_arms_purchases }
			ETH = { has_completed_focus = ETH_international_mediation }
		}
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = ETH
		value = -200
	}
}

ETH_lon_dont_support_ethiopia_with_volunteers = {

	allowed = { has_dlc = "By Blood Alone" }
	enable = {
		is_league_of_nations_member = yes 
		NOT = {
			tag = ETH
		}
	}

	abort = {
		OR = {
			NOT = { has_global_flag = second_italo_ethiopian_war_flag }
			ETH = { has_completed_focus = ETH_international_brigades }
			ETH = { has_completed_focus = ETH_international_mediation }
		}
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = ETH
		value = -200
	}
}

# LoN members should be very keen to support ETH if Italy continues the war after the International Mediation focus has been completed.
ETH_lon_support_ethiopia = {

	allowed = { has_dlc = "By Blood Alone" }
	enable = {
		is_league_of_nations_member = yes 
		ETH = { 
			has_completed_focus = ETH_international_mediation 
			has_war_with = ITA
		}
		has_global_flag = second_italo_ethiopian_war_flag
		NOT = { is_in_faction_with = ITA }
		NOT = {
			tag = ETH
		}
	}

	abort_when_not_enabled = yes 

	ai_strategy = {
		type = send_volunteers_desire
		id = ETH
		value = 400
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = ETH
		value = 400
	}
}

ETH_lon_send_volunteers_to_ethiopia = {

	allowed = { has_dlc = "By Blood Alone" }
	enable = {
		has_country_flag = ETH_support_for_ethiopia_flag
		has_global_flag = second_italo_ethiopian_war_flag
	}

	abort_when_not_enabled = yes 

	ai_strategy = {
		type = send_volunteers_desire
		id = ETH
		value = 400
	}
}

ETH_lon_stop_italy = {

	allowed = { has_dlc = "By Blood Alone" }
	enable = {
		has_global_flag = second_italo_ethiopian_war_flag
		ETH = { has_capitulated = no }
		has_wargoal_against = {
			target = ITA
			type = topple_government
		}
	}

	abort_when_not_enabled = yes 

	ai_strategy = {
		type = antagonize
		id = ITA
		value = 600
	}
	ai_strategy = {
		type = conquer
		id = ITA
		value = 400
	}
	ai_strategy = {
		type = contain
		id = ITA
		value = 400
	}
}

ETH_befriend_uk_a_little = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		is_government_in_exile = yes 
		check_variable = { ETH.host_nation = ENG }
		ENG = {
			has_opinion = {
				target = ROOT
				value < 60
			}
		}
		
	}
	abort_when_not_enabled = yes 

	ai_strategy = {
		type = befriend
		id = ENG
		value = 400
	}
	ai_strategy = {
		type = diplo_action_desire	
		id = ENG
		target = improve_relation
		value = 400
	}
}


ETH_befriend_uk = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		is_government_in_exile = yes 
		check_variable = { ETH.host_nation = ENG }
		ENG = {
			has_opinion = {
				target = ROOT
				value < 90
			}
		}
		date > 1939.1.1 # don't start too soon or everything will go bonkers
	}
	abort_when_not_enabled = yes 

	ai_strategy = {
		type = befriend
		id = ENG
		value = 400
	}
	ai_strategy = {
		type = diplo_action_desire	
		id = ENG
		target = improve_relation
		value = 400
	}
}

ETH_befriend_japan = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		OR = {
			AND = {
				is_government_in_exile = yes 
				check_variable = { ETH.host_nation = JAP }
			}
			JAP = { 
				OR = {
					has_completed_focus = JAP_support_the_kodoha_faction 
					has_completed_focus = JAP_revere_the_emperor_destroy_the_traitors 
				}
			}
		}
		
	}
	abort = {
		OR = {
			AND= {
				has_opinion = {
					target = JAP
					value > 75
				}
				is_government_in_exile = no
			}
			JAP = {
				has_opinion = {
					target = ROOT
					value > 99
				}
			}
		}
	}

	ai_strategy = {
		type = befriend
		id = JAP
		value = 400
	}
	ai_strategy = {
		type = alliance
		id = JAP
		value = 400
	}
	ai_strategy = {
		type = diplo_action_desire	
		id = JAP
		target = improve_relation
		value = 400
	}
}

ETH_befriend_sweden = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		OR = {
			AND = {
				is_government_in_exile = yes 
				check_variable = { ETH.host_nation = SWE }
			}
			ETH = { has_completed_focus = ETH_the_emperor_stays } # Sweden and Italy weren't really friendly after Sweden having so many officers taing part in the war, so if Selassie stays they probably will be friends
		}
		SWE = {
			has_opinion = {
				target = ROOT
				value < 90
			}
		}
		
	}
	abort_when_not_enabled = yes 

	ai_strategy = {
		type = befriend
		id = SWE
		value = 400
	}
	ai_strategy = {
		type = alliance
		id = SWE
		value = 400
	}
	ai_strategy = {
		type = diplo_action_desire	
		id = SWE
		target = improve_relation
		value = 400
	}
}

ETH_befriend_germany = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		OR = {
			AND = {
				is_government_in_exile = yes 
				check_variable = { ETH.host_nation = GER }
			}
			AND = {
				ITA = { is_faction_leader = yes } # If Italy is actively competing with Germany 
				ETH = { is_in_faction = no }
			}
		}
		
	}
	abort_when_not_enabled = yes 

	ai_strategy = {
		type = befriend
		id = GER
		value = 400
	}
	ai_strategy = {
		type = diplo_action_desire	
		id = GER
		target = improve_relation
		value = 400
	}
}

ETH_careful_southern_front = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		has_war_with = ITA 
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = front_control

		strategic_region = 274 # assault Hararghe

		ratio = 0.2

		priority = 100
		ordertype = front
		execution_type = careful
		#execute_order = yes
	}
} 

ETH_careful_northern_front = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		has_war_with = ITA 
		NOT = { 842 = { is_controlled_by = ETH } }
		NOT = { 841 = { is_controlled_by = ETH } }
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = front_control

		strategic_region = 17 # Carefully try to hold Gojjam if Gondar is lost

		ratio = 0.2

		priority = 100
		ordertype = front
		execution_type = careful
		#execute_order = yes
	}
} 

ETH_careful_eastern_front = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		has_war_with = ITA 
		NOT = { 842 = { is_controlled_by = ETH } }
		NOT = { 841 = { is_controlled_by = ETH } }
		NOT = { 843 = { is_controlled_by = ETH } }
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = front_control

		strategic_region = 273 # If we lose if, let's not throw ourselves at it

		ratio = 0.2

		priority = 100
		ordertype = front
		execution_type = careful
		#execute_order = yes
	}
} 

ETH_prepare_to_defend_afar_border = {
	allowed = {
		original_tag = ETH
	}
	enable = {
		has_war_with = ITA
		AFA = { exists = yes }
		date < 1937.1.1
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = prepare_for_war
		id = "AFA"
		value = 200
	}

}