# GEA
GEA_keep_garrison = {
	allowed = { tag = GEA }
	enable = {
		tag = GEA
		GEA = {
			OR = {
				owns_state = 336 # Singapur
				owns_state = 286 # Saigon
				owns_state = 671 #Hanoi
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		ratio = 0.25

		states = {
			336 # Singapur
			286 # Saigon
			671 #Hanoi
		}
	}
	ai_strategy = {
  		type = garrison
   		value = 50
   	}
}

# Keep GEA units in East Indies/SE Asia
KR_keep_GEA_units_home = {
	reversed = yes
	
	enable_reverse = {
		GEA = { is_in_faction_with = GER }
	}
	enable = {
		is_in_faction_with = GEA
		NOT = {
			tag = GEA
			has_war_with = JAP
		}
	}
	target_array = GER.faction_members

	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "GEA"
		value = 100
	}
}
KR_keep_GEA_units_home_2 = {
	enable = {
		is_in_faction_with = GEA
		NOT = {
			tag = GEA
			has_war_with = JAP
		}
		GEA = { is_subject_of = GER }
	}

	abort_when_not_enabled = yes

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

KR_GEA_prewar_strategy = {
	allowed = {
		tag = GEA
	}
	enable = {
		is_subject_of = GER
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = benelux
		value = -1000
	}
	ai_strategy = {
		type = area_priority
		id = germany
		value = -1000
	}
	ai_strategy = {
		type = area_priority
		id = east_indies
		value = 500
	}
	ai_strategy = {
		type = area_priority
		id = se_asia
		value = 500
	}
}

vietnam_war_ally = {
	allowed = {
		original_tag = GEA
	}
	enable = {
		country_exists = VIN
	}
	abort = {
		NOT = { country_exists = INC }
	}

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

	ai_strategy = {
		type = protect
		id = "VIN"
		value = 200
	}

	ai_strategy = {
		type = force_defend_ally_borders
		id = VIN
		value = 200
	}
}


# Navy won't die easily to Japan
KR_GEA_war_strategy = {
	allowed = {
		tag = GEA
	}
	enable = {
		has_war_with = JAP
		OR = {
			naval_strength_ratio = { tag = JAP ratio < 0.75 }
			country_exists = FRA #France is not defeated
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = invade #Not even try islands
		id = "JAP"
		value = -1500
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 79 #Sea of Japan
		value = 100
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 90 #Coast of Japan
		value = 100
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 76 #East China Sea
		value = 100
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 77 #Yellow Sea
		value = 100
	}
	ai_strategy = {
		type = area_priority
		id = east_indies
		value = 1000
	}
	ai_strategy = {
		type = area_priority
		id = se_asia
		value = 1000
	}
}

GEA_naval_focus = {
	allowed = {
		original_tag = GEA
	}
	enable = {
		has_navy_size = { size > 0 }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 20
	}
	ai_strategy = {
		type = naval_invasion_focus
		value = 55
	}
}
