############################################################
###           ESC TECHNOLOGIES : TESLA WEAPONS           ###
############################################################

# ── Tesla Coil											: tier 1 tesla cannon
#     └─ Improved Tesla Coil							: tier 2 tesla cannon
#          └─ Tesla Cannon								: tier 1 tesla lance
#              ├─ Improved Tesla Cannon					: tier 2 tesla lance
#              │   └─ Titanic Tesla Cannon				: titanic tesla lance
#              └─ Omnidirectional Tesla Shockwave		: omnidirectional tesla weapon
# ── Tesla Bomb											: tier 1 tesla torpedo
#     └─ Improved Tesla Bomb							: tier 2 tesla torpedo
# ── Tesla Interdictors									: tesla strikecraft

############################################################
##                       Tesla Coil                       ##
############################################################

esc_tech_tesla_coil_1 = {
	area = physics
	category = { field_manipulation }
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	ai_update_type = military
	prerequisites = { "esc_tech_tesla_weapons" }
	gateway = ESC_TESLA_CANNONS

	technology_swap = {
		name = esc_tech_tesla_coil_1_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
	}
}

############################################################
##                  Improved Tesla Coil                   ##
############################################################

esc_tech_tesla_coil_2 = {
	area = physics
	category = { field_manipulation }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "esc_tech_tesla_coil_1" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_tesla_coil_2_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_coil_2 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_coil_2 }
			}
		}
	}
}

############################################################
##                       Tesla Bomb                       ##
############################################################

esc_tech_tesla_bomb_1 = {
	area = physics
	category = { field_manipulation }
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	ai_update_type = military
	prerequisites = { "esc_tech_tesla_weapons" }
	gateway = ESC_TESLA_TORPEDOES

	technology_swap = {
		name = esc_tech_tesla_bomb_1_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.0
			country_uses_bio_ships = no
			NOT = { has_technology = "tech_torpedoes_3" }
		}
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.0
			country_uses_bio_ships = no
			NOT = { has_technology = "tech_torpedoes_3" }
		}
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
	}
}

############################################################
##                  Improved Tesla Bomb                   ##
############################################################

esc_tech_tesla_bomb_2 = {
	area = physics
	category = { field_manipulation }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "esc_tech_tesla_bomb_1" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_tesla_bomb_2_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_bomb_1 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_bomb_1 }
			}
		}
	}
}

############################################################
##                      Tesla Cannon                      ##
############################################################

esc_tech_tesla_cannon_1 = {
	area = physics
	category = { field_manipulation }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = military
	prerequisites = { "esc_tech_tesla_coil_2" }
	gateway = ESC_TESLA_LANCES

	technology_swap = {
		name = esc_tech_tesla_cannon_1_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_x_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
	}
}

############################################################
##                  Improved Tesla Coil                   ##
############################################################

esc_tech_tesla_cannon_2 = {
	area = physics
	category = { field_manipulation }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	ai_update_type = military
	prerequisites = { "esc_tech_tesla_cannon_1" }
	is_rare = yes
	gateway = ESC_TESLA_LANCES

	technology_swap = {
		name = esc_tech_tesla_cannon_2_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_x_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_cannon_2 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_cannon_2 }
			}
		}
	}
}

############################################################
##                  Titanic Tesla Coil                    ##
############################################################

esc_tech_tesla_cannon_titanic = {
	area = physics
	category = { field_manipulation }
	tier = 6
	cost = @ESC_TECH_tier6_cost3
	weight = @ESC_TECH_tier6_weight3
	ai_update_type = military
	prerequisites = { "esc_tech_tesla_cannon_2" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_tesla_cannon_titanic_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		ESC_TRIGGER_may_research_oversized_weapons = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_x_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_cannon_titanic }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_cannon_titanic }
			}
		}
	}
}

############################################################
##                    Tesla Interdictor                   ##
############################################################

esc_tech_tesla_interdictor = {
	area = physics
	category = { voidcraft }
	tier = 5
	cost = @tier5cost2
	weight = @tier5weight2
	ai_update_type = military
	prerequisites = { "tech_strike_craft_3" "esc_tech_tesla_weapons" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_tesla_interdictor_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_interdictor }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_tesla_interdictor }
			}
		}
	}
}

############################################################
##             Omnidirectional Tesla Discharge            ##
############################################################

esc_tech_shockwave_tesla = {
	area = physics
	category = { particles }
	tier = 6
	cost = @ESC_TECH_tier6_cost3
	weight = @ESC_TECH_tier6_weight3
	ai_update_type = military
	prerequisites = { "esc_tech_shockwave" "tech_titans" "esc_tech_tesla_cannon_1" }
	is_rare = yes

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_tesla_weapons_forbidden }
		ESC_TRIGGER_may_research_oversized_weapons = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0.8
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 0.9
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.1
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.2
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
	}
}
