############################################################
###                      ESC armies                      ###
############################################################

### Psionic Avatar : Psionic weapons' subtree
esc_psionic_avatar_army = {
	damage = 5.0
	health = 7.0
	morale_damage = 2.0
	war_exhaustion = 5.0
	time = 25
	has_species = no
	has_morale = no

	icon = GFX_esc_army_psi_avatar

	resources = {
		category = armies
		cost = {
			energy = 2500
			sr_zro = 100
		}
	}

	show_tech_unlock_if = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_psionic_weapons_forbidden }
	}

	potential_country = {
		OR = {
			NOT = { has_authority = auth_machine_intelligence }
			has_country_flag = ESC_COUNTRY_FLAG_machine_psionics
			has_country_flag = ESC_COUNTRY_FLAG_mod_allow_basic_psionic_weapons
		}
	}
	potential = {
		custom_tooltip = {
			planet = { is_capital = yes }
		}
	}

	prerequisites = { esc_tech_psi_avatar_army }

	ai_weight = {
		base = 100
		modifier = {
			set = 0
			is_fallen_empire = yes
			NOT = { has_ethic = ethic_fanatic_spiritualist }
		}
	}
}

### Erasure Squad : Chrono-spatial weapons' subtree
esc_erasure_squad_army = {
	damage = 7.0
	health = 2.0
	morale = 2.0
	morale_damage = 3.0
	war_exhaustion = 3.0
	time = 360

	icon = GFX_esc_army_chrono_trooper

	resources = {
		category = armies
		cost = {
			energy = 250
			minerals = 500
			sr_dark_matter = 10
		}
		upkeep = {
			energy = 2
		}
	}

	show_tech_unlock_if = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_chronospatial_weapons_forbidden }
		NOR = {
			has_authority = auth_machine_intelligence
			is_individual_machine = yes
		}
	}

	potential_country = {
		NOR = {
			has_authority = auth_machine_intelligence
			is_individual_machine = yes
		}
	}
	potential = {
		from = {
			NOR = {
				has_trait = "trait_mechanical"
				has_trait = "trait_machine_unit"
				is_sapient = no
			}
		}
	}

	prerequisites = { esc_tech_chrono_spatial_weapons }

	ai_weight = {
		base = 100
	}
}

### Eradicator Droids : mechanical verions of Erasure Squads
esc_eradicator_droids_army = {
	damage = 7.0
	health = 2.0
	morale_damage = 3.0
	war_exhaustion = 3.0
	time = 360
	has_morale = no
	has_species = no

	icon = GFX_esc_army_chrono_trooper

	resources = {
		category = armies
		cost = {
			energy = 250
			alloys = 200
			sr_dark_matter = 10
		}
		upkeep = {
			energy = 2
		}
	}

	show_tech_unlock_if = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_chronospatial_weapons_forbidden }
		has_authority = auth_machine_intelligence
		is_individual_machine = yes
	}

	potential_country = {
		OR = {
			has_authority = auth_machine_intelligence
			has_tradition = tr_synthetics_transubstatiation_synthesis
			is_individual_machine = yes
		}
	}

	prerequisites = { esc_tech_chrono_spatial_weapons }

	ai_weight = {
		base = 100
	}
}

### Tesla Troopers : organic tesla armies
esc_tesla_troopers_army = {
	damage = 3.5
	health = 4.0
	morale = 2.0
	morale_damage = 2.0
	war_exhaustion = 1.5
	time = 360

	icon = GFX_esc_army_tesla_trooper

	resources = {
		category = armies
		cost = {
			energy = 150
			minerals = 400
		}
		upkeep = {
			energy = 1
		}
	}

	show_tech_unlock_if = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
		NOR = {
			has_authority = auth_machine_intelligence
			is_individual_machine = yes
		}
	}

	potential_country = {
		NOR = {
			has_authority = auth_machine_intelligence
			is_individual_machine = yes
		}
	}
	potential = {
		from = {
			NOR = {
				has_trait = "trait_mechanical"
				has_trait = "trait_machine_unit"
				is_sapient = no
			}
		}
	}

	prerequisites = { esc_tech_tesla_weapons }

	ai_weight = {
		base = 100
	}
}

### Tesla Droids : mechanical tesla armies
esc_tesla_droids_army = {
	damage = 3.5
	health = 4.0
	morale_damage = 2.0
	war_exhaustion = 1.5
	time = 360
	has_morale = no
	has_species = no

	icon = GFX_esc_army_tesla_trooper

	resources = {
		category = armies
		cost = {
			energy = 150
			alloys = 100
		}
		upkeep = {
			energy = 1
		}
	}

	show_tech_unlock_if = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
		has_authority = auth_machine_intelligence
		is_individual_machine = yes
	}

	potential_country = {
		OR = {
			has_authority = auth_machine_intelligence
			has_tradition = tr_synthetics_transubstatiation_synthesis
			is_individual_machine = yes
		}
	}

	prerequisites = { esc_tech_tesla_weapons }

	ai_weight = {
		base = 100
	}
}

### Bio-Horror Horde : advanced bio-ascension army
esc_biohorror_army = {
	health = 4.0
	damage = 4.0
	morale_damage = 2.5
	collateral_damage = 4.0
	war_exhaustion = 0.25
	time = 100
	has_morale = no
	has_species = no

	icon = GFX_army_type_xenomorph

	resources = {
		category = armies
		cost = {
			minerals = 350
		}
		upkeep = {
			energy = 2
		}
	}

	potential_country = {
		ESC_TRIGGER_may_research_biological_weapons_advanced = yes
	}

	prerequisites = { esc_tech_bio_horror_army }

	ai_weight = {
		base = 10
		modifier = {
			factor = 10
			is_xenophobe = yes
		}
		modifier = {
			set = 0
			OR = {
				is_pacifist = yes
				is_xenophile = yes
			}
		}
		modifier = {
			set = 0
			is_fallen_empire = yes
			NOT = { has_ethic = ethic_fanatic_xenophobe }
		}
	}
}
