############################################################
###          ESC TECHNOLOGIES : KINETIC WEAPONS          ###
############################################################

# ── Advanced Gauss Cannon					: tier 6 mass driver weapon
#     └─ Strike Cannon						: tier 7 mass driver weapon
# ── Improved Stormfire Autocannon			: tier 4 autocannon weapon
#     └─ Shredder Autocannon				: tier 5 autocannon weapon
# ── Improved Kinetic Artillery				: tier 3 artillery weapon
#     └─ Skypiercer Artillery				: tier 4 artillery weapon
# ── Improved Giga-Cannon					: tier 3 mass accelerator XL weapon
#     └─ The Grand Cannon					: tier 4 mass accelerator XL weapon
#         └─ RKKV							: titanic kinetic weapon
# ── Improved Flak Artillery				: tier 4 flak battery
#     └─ Ironcloud Defender					: tier 5 flak battery
# ── Protector Point Defense				: tier 4 point defense cannon
#     └─ Iron Curtain Point Defense			: tier 5 point defense cannon
# ── Hailstorm Autocannon					: tier 1 X-slot autocannon
#     └─ Firestorm Autocannon				: tier 2 X-slot autocannon
#         └─ Tempest Autocannon				: titanic autocannon
# ── Juggernaut Artillery					: kinetic artillery for Juggernaut
#     └─ Improved Juggernaut Artillery		: kinetic artillery for Juggernaut
# ── Juggernaut PD System					: point defense for Juggernaut
#     └─ Improved Juggernaut PD System		: point defense for Juggernaut
# ── Ferromagnetic Liquid Cannon			: tier 1 MHD weapon
#     └─ Imp. Ferromagnetic Liquid Cannon	: tier 2 MHD weapon
#         └─ MagnetoHydroDynamic Cannon		: titanic MHD weapon

############################################################
##                    Advanced Gauss Cannon               ##
############################################################

esc_tech_mass_driver_6 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	ai_update_type = military
	prerequisites = { "tech_mass_drivers_5" "esc_tech_new_age_warfare" }
	gateway = ESC_MASS_DRIVERS

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

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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
		}
	}
}

############################################################
##                        Strike Cannon                   ##
############################################################

esc_tech_mass_driver_7 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "esc_tech_mass_driver_6" }
	is_rare = yes

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

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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_mass_driver_7 }
			}
		}
	}

	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_mass_driver_7 }
			}
		}
	}
}

############################################################
##                Improved Stormfire Autocannon           ##
############################################################

esc_tech_autocannon_4 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	ai_update_type = military
	prerequisites = { "tech_autocannons_3" "esc_tech_new_age_warfare" }
	gateway = ESC_AUTOCANNONS

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

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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
		}
	}
}

############################################################
##                     Shredder Autocannon                ##
############################################################

esc_tech_autocannon_5 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "esc_tech_autocannon_4" }
	is_rare = yes

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

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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_autocannon_5 }
			}
		}
	}

	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_autocannon_5 }
			}
		}
	}
}

############################################################
##                 Improved Kinetic Artillery             ##
############################################################

esc_tech_kinetic_artillery_3 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost2
	weight = @tier5weight2
	ai_update_type = military
	prerequisites = { "tech_kinetic_artillery_2" "esc_tech_new_age_warfare" }
	gateway = ESC_KINETIC_ARTILLERY

	technology_swap = {
		name = esc_tech_kinetic_artillery_3_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
			is_galvanic_empire = no
		}
		weight = { factor = 1 }
	}
	technology_swap = {
		name = esc_tech_lm_accelerator_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = no
			is_galvanic_empire = yes
		}
		weight = { factor = 1 }
	}
	technology_swap = {
		name = esc_tech_lm_bio_accelerator_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
			is_galvanic_empire = yes
		}
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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
		}
	}
}

############################################################
##                    Skypiercer Artillery                ##
############################################################

esc_tech_kinetic_artillery_4 = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = military
	prerequisites = { "esc_tech_kinetic_artillery_3" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_kinetic_artillery_4_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
			is_galvanic_empire = no
		}
		weight = { factor = 1 }
	}
	technology_swap = {
		name = esc_tech_lm_accelerator_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = no
			is_galvanic_empire = yes
		}
		weight = { factor = 1 }
	}
	technology_swap = {
		name = esc_tech_lm_bio_accelerator_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
			is_galvanic_empire = yes
		}
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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_kinetic_artillery_4 }
			}
		}
	}

	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_kinetic_artillery_4 }
			}
		}
	}
}

############################################################
##                    Improved Giga-Cannon                ##
############################################################

esc_tech_giga_cannon_3 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "tech_mass_accelerator_2" "esc_tech_advanced_heavy_weapons" }
	gateway = ESC_GIGA_CANNONS

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

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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
		}
	}
}

############################################################
##                     The Grand Cannon                   ##
############################################################

esc_tech_giga_cannon_4 = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = military
	prerequisites = { "esc_tech_giga_cannon_3" }
	is_rare = yes

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

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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_giga_cannon_4 }
			}
		}
	}

	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_giga_cannon_4 }
			}
		}
	}
}

############################################################
##             Relativistic Kinetic Kill Vehicle          ##
############################################################

esc_tech_giga_cannon_titanic = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	ai_update_type = military
	prerequisites = { "esc_tech_giga_cannon_4" }
	is_rare = yes
	is_reverse_engineerable = no

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

	### Apocalypse DLC version
	potential = {
		ESC_TRIGGER_may_research_oversized_weapons = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_x_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_titans
				has_technology = tech_juggernaut
			}
		}
	    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_giga_cannon_titanic }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_titans
				has_technology = tech_juggernaut
			}
		}
	    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_giga_cannon_titanic }
			}
		}
	}
}

############################################################
##                    Hailstorm Autocannon                ##
############################################################

esc_tech_autocannon_x_1 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "esc_tech_autocannon_5" "esc_tech_advanced_heavy_weapons" }
	gateway = ESC_X_AUTOCANNONS

	technology_swap = {
		name = esc_tech_autocannon_x_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_xautocannons_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
		}
	}
}

############################################################
##                 Firestorm Autocannon                   ##
############################################################

esc_tech_autocannon_x_2 = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = military
	prerequisites = { "esc_tech_autocannon_x_1" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_autocannon_x_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_xautocannons_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_autocannon_x_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_autocannon_x_2 }
			}
		}
	}
}

############################################################
##                   Tempest Autocannon                   ##
############################################################

esc_tech_autocannon_titanic = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	ai_update_type = military
	prerequisites = { "esc_tech_autocannon_x_2" }
	is_rare = yes
	is_reverse_engineerable = no

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

	### Apocalypse DLC version
	potential = {
		ESC_TRIGGER_may_research_oversized_weapons = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_xautocannons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_titans
				has_technology = tech_juggernaut
			}
		}
	    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_autocannon_titanic }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_titans
				has_technology = tech_juggernaut
			}
		}
	    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_autocannon_titanic }
			}
		}
	}
}

############################################################
##                    Juggernaut Artillery                ##
############################################################

esc_tech_juggernaut_artillery_1 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "tech_juggernaut" }
	gateway = ESC_JUGGERNAUT_ARTILLERY

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

	potential = {
		host_has_dlc = "Federations"
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = esc_tech_mass_driver_6
				has_technology = esc_tech_autocannon_4
				has_technology = esc_tech_kinetic_artillery_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
			NOR = {
				has_technology = esc_tech_mass_driver_6
				has_technology = esc_tech_autocannon_4
				has_technology = esc_tech_kinetic_artillery_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 Juggernaut Artillery             ##
############################################################

esc_tech_juggernaut_artillery_2 = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	ai_update_type = military
	prerequisites = { "esc_tech_juggernaut_artillery_1" }
	is_rare = yes

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

	potential = {
		host_has_dlc = "Federations"
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_adv_vanilla_kinetic_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_juggernaut_artillery_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_juggernaut_artillery_2 }
			}
		}
	}
}

############################################################
##               Ferromagnetic Liquid Cannon              ##
############################################################

esc_tech_mhd_cannon_1 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	ai_update_type = military
	prerequisites = { "esc_tech_advanced_heavy_weapons" "esc_tech_advanced_materials" "tech_mass_accelerator_2" }
	gateway = ESC_MHD_CANNONS

	technology_swap = {
		name = esc_tech_mhd_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_mhd_cannons_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 Ferromagnetic Liquid Cannon          ##
############################################################

esc_tech_mhd_cannon_2 = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = military
	prerequisites = { "esc_tech_mhd_cannon_1" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_mhd_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_mhd_cannons_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_mhd_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_mhd_cannon_2 }
			}
		}
	}
}

############################################################
##              MagnetoHydroDynamic Cannon                ##
############################################################

esc_tech_mhd_cannon_titanic = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	ai_update_type = military
	prerequisites = { "esc_tech_mhd_cannon_2" }
	is_rare = yes
	is_reverse_engineerable = no

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

	### Apocalypse DLC version
	potential = {
		ESC_TRIGGER_may_research_oversized_weapons = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_mhd_cannons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_titans
				has_technology = tech_juggernaut
			}
		}
	    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_mhd_cannon_titanic }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_titans
				has_technology = tech_juggernaut
			}
		}
	    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_mhd_cannon_titanic }
			}
		}
	}
}
