############################################################
##            Component: Archaeotech components           ##
############################################################

# - Tech-Synthetic Beam Cannon				S/M/L
# - Advanced Tech-Synthetic Beam Cannon		S/M/L
# - Tech-Synthetic Batteries				S/M/L
# - Advanced Tech-Synthetic Batteries		S/M/L
# - Tech-Synthetic Artillery				X
# - Advanced Tech-Synthetic Artillery		X
# - Tech-Synthetic Nano-Missiles			S
# - Advanced Tech-Synthetic Nano-Missiles	S
# - Tech-Synthetic CIWS						P
# - Advanced Tech-Synthetic CIWS			P
# - Tech-Synthetic Ruinator					Titanic
# - Advanced Tech-Synthetic Ruinator		Titanic
# - Tech-Synthetic Drone Crafts				H
# - Advanced Tech-Synthetic Drone Crafts	H
#
# - Tech-Synthetic Armor					S/M/L
# - Advanced Tech-Synthetic Armor			S/M/L
# - Tech-Synthetic Shields					S/M/L
# - Advanced Tech-Synthetic Shields			S/M/L

############################################################
##               Tech-Synthetic Beam Cannon               ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_ARCHAEO_LASER_2
	size = small
	icon = GFX_esc_archaeo_laser_2
	icon_frame = 1
	type = instant

	damage = { min = 16 max = 54 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.9
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_archaeo_laser_2" }
	component_set = ESC_ARCHAEO_LASER_2
	projectile_gfx = "dark_matter_laser_s"
	tags = { weapon_type_energy weapon_archaeotech s_slot }
	ai_tags = { weapon_role_anti_armor gunship }
	upgrades_to = SMALL_ESC_ARCHAEO_LASER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_LASER_2
	size = small
	icon = GFX_esc_bio_archaeo_laser_2
	icon_frame = 1
	type = instant

	damage = { min = 16 max = 54 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.9
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_archaeo_laser_2" }
	component_set = ESC_BIO_ARCHAEO_LASER_2
	projectile_gfx = "dark_matter_laser_s"
	tags = { weapon_type_energy weapon_archaeotech s_slot }
	ai_tags = { weapon_role_anti_armor gunship }
	upgrades_to = SMALL_ESC_BIO_ARCHAEO_LASER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_ARCHAEO_LASER_2
	size = medium
	icon = GFX_esc_archaeo_laser_2
	icon_frame = 1
	type = instant

	damage = { min = 48 max = 132 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_2
	accuracy = 0.9
	power = -34

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_laser_2" }
	component_set = ESC_ARCHAEO_LASER_2
	projectile_gfx = "dark_matter_laser_m"
	tags = { weapon_type_energy weapon_archaeotech m_slot }
	ai_tags = { weapon_role_anti_armor gunship }
	upgrades_to = MEDIUM_ESC_ARCHAEO_LASER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_LASER_2
	size = medium
	icon = GFX_esc_bio_archaeo_laser_2
	icon_frame = 1
	type = instant

	damage = { min = 48 max = 132 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_2
	accuracy = 0.9
	power = -34

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_laser_2" }
	component_set = ESC_BIO_ARCHAEO_LASER_2
	projectile_gfx = "dark_matter_laser_m"
	tags = { weapon_type_energy weapon_archaeotech m_slot }
	ai_tags = { weapon_role_anti_armor gunship }
	upgrades_to = MEDIUM_ESC_BIO_ARCHAEO_LASER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_ARCHAEO_LASER_2
	size = large
	icon = GFX_esc_archaeo_laser_2
	icon_frame = 1
	type = instant

	damage = { min = 118 max = 288 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	accuracy = 0.9
	power = -68

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_archaeo_laser_2" }
	component_set = ESC_ARCHAEO_LASER_2
	projectile_gfx = "dark_matter_laser_l"
	tags = { weapon_type_energy weapon_archaeotech l_slot }
	ai_tags = { weapon_role_anti_armor gunship }
	upgrades_to = LARGE_ESC_ARCHAEO_LASER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_LASER_2
	size = large
	icon = GFX_esc_bio_archaeo_laser_2
	icon_frame = 1
	type = instant

	damage = { min = 118 max = 288 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	accuracy = 0.9
	power = -68

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_archaeo_laser_2" }
	component_set = ESC_BIO_ARCHAEO_LASER_2
	projectile_gfx = "dark_matter_laser_l"
	tags = { weapon_type_energy weapon_archaeotech l_slot }
	ai_tags = { weapon_role_anti_armor gunship }
	upgrades_to = LARGE_ESC_BIO_ARCHAEO_LASER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##          Advanced Tech-Synthetic Beam Cannon           ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_ARCHAEO_LASER_3
	size = small
	icon = GFX_esc_archaeo_laser_3
	icon_frame = 1
	type = instant

	damage = { min = 21 max = 70 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.9
	power = -24

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_archaeo_laser_3" }
	component_set = ESC_ARCHAEO_LASER_3
	projectile_gfx = "dark_matter_laser_s"
	tags = { weapon_type_energy weapon_archaeotech s_slot }
	ai_tags = { weapon_role_anti_armor gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_LASER_3
	size = small
	icon = GFX_esc_bio_archaeo_laser_3
	icon_frame = 1
	type = instant

	damage = { min = 21 max = 70 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.9
	power = -24

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_archaeo_laser_3" }
	component_set = ESC_BIO_ARCHAEO_LASER_3
	projectile_gfx = "dark_matter_laser_s"
	tags = { weapon_type_energy weapon_archaeotech s_slot }
	ai_tags = { weapon_role_anti_armor gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_ARCHAEO_LASER_3
	size = medium
	icon = GFX_esc_archaeo_laser_3
	icon_frame = 1
	type = instant

	damage = { min = 68 max = 164 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_2
	accuracy = 0.9
	power = -46

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_laser_3" }
	component_set = ESC_ARCHAEO_LASER_3
	projectile_gfx = "dark_matter_laser_m"
	tags = { weapon_type_energy weapon_archaeotech m_slot }
	ai_tags = { weapon_role_anti_armor gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_LASER_3
	size = medium
	icon = GFX_esc_bio_archaeo_laser_3
	icon_frame = 1
	type = instant

	damage = { min = 68 max = 164 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_2
	accuracy = 0.9
	power = -46

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_laser_3" }
	component_set = ESC_BIO_ARCHAEO_LASER_3
	projectile_gfx = "dark_matter_laser_m"
	tags = { weapon_type_energy weapon_archaeotech m_slot }
	ai_tags = { weapon_role_anti_armor gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_ARCHAEO_LASER_3
	size = large
	icon = GFX_esc_archaeo_laser_3
	icon_frame = 1
	type = instant

	damage = { min = 162 max = 368 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	accuracy = 0.9
	power = -90

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_archaeo_laser_3" }
	component_set = ESC_ARCHAEO_LASER_3
	projectile_gfx = "dark_matter_laser_l"
	tags = { weapon_type_energy weapon_archaeotech l_slot }
	ai_tags = { weapon_role_anti_armor gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_LASER_3
	size = large
	icon = GFX_esc_bio_archaeo_laser_3
	icon_frame = 1
	type = instant

	damage = { min = 162 max = 368 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	accuracy = 0.9
	power = -90

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_laser_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_laser_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_laser_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_laser_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_laser_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_archaeo_laser_3" }
	component_set = ESC_BIO_ARCHAEO_LASER_3
	projectile_gfx = "dark_matter_laser_l"
	tags = { weapon_type_energy weapon_archaeotech l_slot }
	ai_tags = { weapon_role_anti_armor gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##                Tech-Synthetic Batteries                ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_ARCHAEO_MASS_DRIVER_2
	size = small
	icon = GFX_esc_archaeo_mass_driver_2
	icon_frame = 1
	type = instant

	damage = { min = 16 max = 51 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -16

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.5

	prerequisites = { esc_tech_archaeo_mass_driver_2 }
	component_set = ESC_ARCHAEO_MASS_DRIVER_2
	projectile_gfx = "mass_driver_s"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = SMALL_ESC_ARCHAEO_MASS_DRIVER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_MASS_DRIVER_2
	size = small
	icon = GFX_esc_bio_archaeo_mass_driver_2
	icon_frame = 1
	type = instant

	damage = { min = 16 max = 51 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -16

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.5

	prerequisites = { esc_tech_archaeo_mass_driver_2 }
	component_set = ESC_BIO_ARCHAEO_MASS_DRIVER_2
	projectile_gfx = "mass_driver_s"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = SMALL_ESC_BIO_ARCHAEO_MASS_DRIVER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

#medium
weapon_component_template = {
	key = MEDIUM_ESC_ARCHAEO_MASS_DRIVER_2
	size = medium
	icon = GFX_esc_archaeo_mass_driver_2
	icon_frame = 1
	type = instant

	damage = { min = 45 max = 136 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_L_5
	accuracy = 0.75
	power = -32

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.3

	prerequisites = { esc_tech_archaeo_mass_driver_2 }
	component_set = ESC_ARCHAEO_MASS_DRIVER_2
	projectile_gfx = "mass_driver_m"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = MEDIUM_ESC_ARCHAEO_MASS_DRIVER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_MASS_DRIVER_2
	size = medium
	icon = GFX_esc_bio_archaeo_mass_driver_2
	icon_frame = 1
	type = instant

	damage = { min = 45 max = 136 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_L_5
	accuracy = 0.75
	power = -32

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.3

	prerequisites = { esc_tech_archaeo_mass_driver_2 }
	component_set = ESC_BIO_ARCHAEO_MASS_DRIVER_2
	projectile_gfx = "mass_driver_m"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = MEDIUM_ESC_BIO_ARCHAEO_MASS_DRIVER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_ARCHAEO_MASS_DRIVER_2
	size = large
	icon = GFX_esc_archaeo_mass_driver_2
	icon_frame = 1
	type = instant

	damage = { min = 104 max = 288 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -64

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.05

	prerequisites = { esc_tech_archaeo_mass_driver_2 }
	component_set = ESC_ARCHAEO_MASS_DRIVER_2
	projectile_gfx = "mass_driver_l"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = LARGE_ESC_ARCHAEO_MASS_DRIVER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_MASS_DRIVER_2
	size = large
	icon = GFX_esc_bio_archaeo_mass_driver_2
	icon_frame = 1
	type = instant

	damage = { min = 104 max = 288 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -64

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.05

	prerequisites = { esc_tech_archaeo_mass_driver_2 }
	component_set = ESC_BIO_ARCHAEO_MASS_DRIVER_2
	projectile_gfx = "mass_driver_l"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = LARGE_ESC_BIO_ARCHAEO_MASS_DRIVER_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

############################################################
##           Advanced Tech-Synthetic Batteries            ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_ARCHAEO_MASS_DRIVER_3
	size = small
	icon = GFX_esc_archaeo_mass_driver_3
	icon_frame = 1
	type = instant

	damage = { min = 22 max = 70 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.5

	prerequisites = { esc_tech_archaeo_mass_driver_3 }
	component_set = ESC_ARCHAEO_MASS_DRIVER_3
	projectile_gfx = "mass_driver_s"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_MASS_DRIVER_3
	size = small
	icon = GFX_esc_bio_archaeo_mass_driver_3
	icon_frame = 1
	type = instant

	damage = { min = 22 max = 70 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.5

	prerequisites = { esc_tech_archaeo_mass_driver_3 }
	component_set = ESC_BIO_ARCHAEO_MASS_DRIVER_3
	projectile_gfx = "mass_driver_s"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

#medium
weapon_component_template = {
	key = MEDIUM_ESC_ARCHAEO_MASS_DRIVER_3
	size = medium
	icon = GFX_esc_archaeo_mass_driver_3
	icon_frame = 1
	type = instant

	damage = { min = 63 max = 170 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_L_5
	accuracy = 0.75
	power = -40

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.3

	prerequisites = { esc_tech_archaeo_mass_driver_3 }
	component_set = ESC_ARCHAEO_MASS_DRIVER_3
	projectile_gfx = "mass_driver_m"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_MASS_DRIVER_3
	size = medium
	icon = GFX_esc_bio_archaeo_mass_driver_3
	icon_frame = 1
	type = instant

	damage = { min = 63 max = 170 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_L_5
	accuracy = 0.75
	power = -40

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.3

	prerequisites = { esc_tech_archaeo_mass_driver_3 }
	component_set = ESC_BIO_ARCHAEO_MASS_DRIVER_3
	projectile_gfx = "mass_driver_m"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_ARCHAEO_MASS_DRIVER_3
	size = large
	icon = GFX_esc_archaeo_mass_driver_3
	icon_frame = 1
	type = instant

	damage = { min = 150 max = 368 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -80

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.05

	prerequisites = { esc_tech_archaeo_mass_driver_3 }
	component_set = ESC_ARCHAEO_MASS_DRIVER_3
	projectile_gfx = "mass_driver_l"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_MASS_DRIVER_3
	size = large
	icon = GFX_esc_bio_archaeo_mass_driver_3
	icon_frame = 1
	type = instant

	damage = { min = 150 max = 368 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -80

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_railgun_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_railgun_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_railgun_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_railgun_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_railgun_shield_damage
	tracking = 0.05

	prerequisites = { esc_tech_archaeo_mass_driver_3 }
	component_set = ESC_BIO_ARCHAEO_MASS_DRIVER_3
	projectile_gfx = "mass_driver_l"
	tags = { weapon_type_kinetic weapon_archaeotech }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

############################################################
##                Tech-Synthetic Artillery                ##
############################################################

weapon_component_template = {
	key = ESC_ARCHAEO_MASS_ACCELERATOR_2
	size = extra_large
	icon = GFX_esc_archaeo_mass_accelerator_2
	icon_frame = 1
	type = instant

    damage = { min = 1200 max = 3200 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -225

	firing_arc = 25.0
	min_range = 45.0
	#use_ship_kill_target = no

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 6
	}

	hull_damage = @ESC_WEAPON_archaeo_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_artillery_shield_damage
	tracking = 0

	prerequisites = { "esc_tech_archaeo_mass_accelerator_2" }
	component_set = ESC_ARCHAEO_MASS_ACCELERATOR_2
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic weapon_archaeotech weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0
	upgrades_to = ESC_ARCHAEO_MASS_ACCELERATOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_ARCHAEO_MASS_ACCELERATOR_2
	size = extra_large
	icon = GFX_esc_bio_archaeo_mass_accelerator_2
	icon_frame = 1
	type = instant

    damage = { min = 1200 max = 3200 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -225

	firing_arc = 25.0
	min_range = 45.0
	#use_ship_kill_target = no

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 6
	}

	hull_damage = @ESC_WEAPON_archaeo_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_artillery_shield_damage
	tracking = 0

	prerequisites = { "esc_tech_archaeo_mass_accelerator_2" }
	component_set = ESC_BIO_ARCHAEO_MASS_ACCELERATOR_2
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic weapon_archaeotech weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0
	upgrades_to = ESC_BIO_ARCHAEO_MASS_ACCELERATOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

############################################################
##           Advanced Tech-Synthetic Artillery            ##
############################################################

weapon_component_template = {
	key = ESC_ARCHAEO_MASS_ACCELERATOR_3
	size = extra_large
	icon = GFX_esc_archaeo_mass_accelerator_3
	icon_frame = 1
	type = instant

    damage = { min = 1500 max = 3700 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -250

	firing_arc = 25.0
	min_range = 45.0
	#use_ship_kill_target = no

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
	}

	hull_damage = @ESC_WEAPON_archaeo_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_artillery_shield_damage
	tracking = 0.05

	prerequisites = { esc_tech_archaeo_mass_accelerator_3 }
	component_set = ESC_ARCHAEO_MASS_ACCELERATOR_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic weapon_archaeotech weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_ARCHAEO_MASS_ACCELERATOR_3
	size = extra_large
	icon = GFX_esc_bio_archaeo_mass_accelerator_3
	icon_frame = 1
	type = instant

    damage = { min = 1500 max = 3700 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.75
	power = -250

	firing_arc = 25.0
	min_range = 45.0
	#use_ship_kill_target = no

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
	}

	hull_damage = @ESC_WEAPON_archaeo_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_artillery_shield_damage
	tracking = 0.05

	prerequisites = { esc_tech_archaeo_mass_accelerator_3 }
	component_set = ESC_BIO_ARCHAEO_MASS_ACCELERATOR_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic weapon_archaeotech weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

############################################################
##              Tech-Synthetic Nano-Missiles              ##
############################################################

weapon_component_template = {
	key = ESC_ARCHAEO_MISSILES_2
	size = small
	icon = GFX_esc_archaeo_missiles_2
	icon_frame = 1
	type = missile

	damage = { min = 4 max = 6 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_G_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_3
	missile_evasion = 0.25
	missile_health = 8
	missile_armor = 7
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	power = -15

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_missile_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_missile_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_missile_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_missile_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_missile_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_archaeo_missiles_2" }
	component_set = ESC_ARCHAEO_MISSILES_2
	projectile_gfx = "small_missile"
	tags = { weapon_type_explosive weapon_archaeotech }
	ai_tags = { weapon_role_artillery artillery energy_torpedoes }
	ai_tag_weight = 0
	upgrades_to = ESC_ARCHAEO_MISSILES_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_MISSILES_2
	size = medium
	icon = GFX_esc_bio_archaeo_missiles_2
	icon_frame = 1
	type = missile

	damage = { min = 6 max = 8 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_G_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_3
	missile_evasion = 0.25
	missile_health = 8
	missile_armor = 7
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	power = -15

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_missile_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_missile_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_missile_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_missile_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_missile_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_archaeo_missiles_2" }
	component_set = ESC_BIO_ARCHAEO_MISSILES_2
	projectile_gfx = "small_missile"
	tags = { weapon_type_explosive weapon_archaeotech }
	ai_tags = { weapon_role_artillery artillery energy_torpedoes }
	ai_tag_weight = 0
	upgrades_to = MEDIUM_ESC_BIO_ARCHAEO_MISSILES_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ship_uses_stinger_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = TORPEDO_ESC_BIO_ARCHAEO_MISSILES_2
	size = torpedo
	icon = GFX_esc_bio_archaeo_missiles_2
	icon_frame = 1
	type = missile

	damage = { min = 6 max = 8 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_G_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_3
	missile_evasion = 0.25
	missile_health = 8
	missile_armor = 7
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	power = -15

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_missile_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_missile_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_missile_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_missile_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_missile_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_archaeo_missiles_2" }
	component_set = ESC_BIO_ARCHAEO_MISSILES_2
	projectile_gfx = "small_missile"
	tags = { weapon_type_explosive weapon_archaeotech }
	ai_tags = { weapon_role_artillery artillery energy_torpedoes }
	ai_tag_weight = 0
	upgrades_to = TORPEDO_ESC_BIO_ARCHAEO_MISSILES_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ship_uses_harbinger_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##         Advanced Tech-Synthetic Nano-Missiles          ##
############################################################

weapon_component_template = {
	key = ESC_ARCHAEO_MISSILES_3
	size = small
	icon = GFX_esc_archaeo_missiles_3
	icon_frame = 1
	type = missile

	damage = { min = 5 max = 8 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_G_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_3
	missile_evasion = 0.3
	missile_health = 10
	missile_armor = 10
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_missile_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_missile_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_missile_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_missile_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_missile_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_archaeo_missiles_3" }
	component_set = ESC_ARCHAEO_MISSILES_3
	projectile_gfx = "small_missile"
	tags = { weapon_type_explosive weapon_archaeotech }
	ai_tags = { weapon_role_artillery artillery energy_torpedoes }
	ai_tag_weight = 0

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_MISSILES_3
	size = medium
	icon = GFX_esc_bio_archaeo_missiles_3
	icon_frame = 1
	type = missile

	damage = { min = 8 max = 11 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_G_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_3
	missile_evasion = 0.3
	missile_health = 10
	missile_armor = 10
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_missile_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_missile_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_missile_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_missile_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_missile_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_archaeo_missiles_3" }
	component_set = ESC_BIO_ARCHAEO_MISSILES_3
	projectile_gfx = "small_missile"
	tags = { weapon_type_explosive weapon_archaeotech }
	ai_tags = { weapon_role_artillery artillery energy_torpedoes }
	ai_tag_weight = 0

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ship_uses_stinger_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = TORPEDO_ESC_BIO_ARCHAEO_MISSILES_3
	size = torpedo
	icon = GFX_esc_bio_archaeo_missiles_3
	icon_frame = 1
	type = missile

	damage = { min = 8 max = 11 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_G_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_3
	missile_evasion = 0.3
	missile_health = 10
	missile_armor = 10
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_missile_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_missile_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_missile_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_missile_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_missile_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_archaeo_missiles_3" }
	component_set = ESC_BIO_ARCHAEO_MISSILES_3
	projectile_gfx = "small_missile"
	tags = { weapon_type_explosive weapon_archaeotech }
	ai_tags = { weapon_role_artillery artillery energy_torpedoes }
	ai_tag_weight = 0

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ship_uses_harbinger_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##                  Tech-Synthetic CIWS                   ##
############################################################

weapon_component_template = {
	key = ESC_ARCHAEO_POINTDEFENSE_2
	size = point_defence
	icon = GFX_esc_archaeo_pd_2
	icon_frame = 1
	type = point_defence

	damage = { min = 6 max = 12 }
	windup = { min = 0 max = 0 }
	total_fire_time = 5
	range = @ESC_WEAPON_RANGE_P_1
	accuracy = 0.75
	power = -12

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_pointdef_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_pointdef_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_pointdef_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_pointdef_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_pointdef_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_point_defense_2" }
	component_set = ESC_ARCHAEO_POINTDEFENSE_2
	projectile_gfx = "white_laser_pd"
	tags = { weapon_type_point_defense weapon_type_energy weapon_archaeotech }
	ai_tags = { weapon_role_point_defense screen }
	upgrades_to = ESC_ARCHAEO_POINTDEFENSE_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	point_defence_targets = { "missile" "strike_craft" }

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_ARCHAEO_POINTDEFENSE_2
	size = point_defence
	icon = GFX_esc_bio_archaeo_pd_2
	icon_frame = 1
	type = point_defence

	damage = { min = 6 max = 12 }
	windup = { min = 0 max = 0 }
	total_fire_time = 5
	range = @ESC_WEAPON_RANGE_P_1
	accuracy = 0.75
	power = -12

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 4
	}

	hull_damage = @ESC_WEAPON_archaeo_pointdef_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_pointdef_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_pointdef_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_pointdef_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_pointdef_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_point_defense_2" }
	component_set = ESC_BIO_ARCHAEO_POINTDEFENSE_2
	projectile_gfx = "white_laser_pd"
	tags = { weapon_type_point_defense weapon_type_energy weapon_archaeotech }
	ai_tags = { weapon_role_point_defense screen }
	upgrades_to = ESC_BIO_ARCHAEO_POINTDEFENSE_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ship_uses_weaver_components"
		EXTRA_CONDITION_VALUE = no
		EVAL_TARGET = yes
	}

	point_defence_targets = { "missile" "strike_craft" }

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##             Advanced Tech-Synthetic CIWS               ##
############################################################

weapon_component_template = {
	key = ESC_ARCHAEO_POINTDEFENSE_3
	size = point_defence
	icon = GFX_esc_archaeo_pd_3
	icon_frame = 1
	type = point_defence

	damage = { min = 7 max = 15 }
	windup = { min = 0 max = 0 }
	total_fire_time = 5
	range = @ESC_WEAPON_RANGE_P_1
	accuracy = 0.75
	power = -15

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_pointdef_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_pointdef_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_pointdef_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_pointdef_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_pointdef_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_point_defense_3" }
	component_set = ESC_ARCHAEO_POINTDEFENSE_3
	projectile_gfx = "white_laser_pd"
	tags = { weapon_type_point_defense weapon_type_energy weapon_archaeotech }
	ai_tags = { weapon_role_point_defense screen }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	point_defence_targets = { "missile" "strike_craft" }

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_ARCHAEO_POINTDEFENSE_3
	size = point_defence
	icon = GFX_esc_bio_archaeo_pd_3
	icon_frame = 1
	type = point_defence

	damage = { min = 7 max = 15 }
	windup = { min = 0 max = 0 }
	total_fire_time = 5
	range = @ESC_WEAPON_RANGE_P_1
	accuracy = 0.75
	power = -15

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 5
	}

	hull_damage = @ESC_WEAPON_archaeo_pointdef_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_pointdef_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_pointdef_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_pointdef_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_pointdef_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_archaeo_point_defense_3" }
	component_set = ESC_BIO_ARCHAEO_POINTDEFENSE_3
	projectile_gfx = "white_laser_pd"
	tags = { weapon_type_point_defense weapon_type_energy weapon_archaeotech }
	ai_tags = { weapon_role_point_defense screen }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ship_uses_weaver_components"
		EXTRA_CONDITION_VALUE = no
		EVAL_TARGET = yes
	}

	point_defence_targets = { "missile" "strike_craft" }

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##              Tech-Synthetic Drone Crafts               ##
############################################################

strike_craft_component_template = {
	key = ESC_ARCHAEO_STRIKECRAFT_2
	size = LARGE
	entity = "bomber_entity"
	icon = GFX_esc_archaeo_strikecraft_2
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "strike_craft_laser_3"
	power = -75

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 6
	}

	count = @ESC_STRIKECRAFT_count_large
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 8 max = 23 }
	cooldown = 2.3
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	health = 15
	armor = 0
	shield = 25

	tracking = @ESC_STRIKECRAFT_tracking_fighter
	evasion = @ESC_STRIKECRAFT_evasion
	speed = @ESC_STRIKECRAFT_speed_4
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter

	hull_damage = @ESC_WEAPON_archaeo_crafts_hull_damage
	armor_damage = @ESC_WEAPON_archaeo_crafts_armor_damage
	armor_penetration = @ESC_WEAPON_archaeo_crafts_armor_penetration
	shield_damage = @ESC_WEAPON_archaeo_crafts_shield_damage
	shield_penetration = @ESC_WEAPON_archaeo_crafts_shield_penetration

	ship_behavior = "fighters_behavior"
	component_set = ESC_ARCHAEO_STRIKECRAFT_2
	prerequisites = { "esc_tech_archaeo_strikecraft_2" }
	tags = { weapon_type_strike_craft weapon_archaeotech }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }
	upgrades_to = ESC_ARCHAEO_STRIKECRAFT_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

strike_craft_component_template = {
	key = ESC_BIO_ARCHAEO_STRIKECRAFT_2
	size = LARGE
	entity = "space_amoeba_small_entity"
	icon = GFX_esc_bio_archaeo_strikecraft_2
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "strike_craft_laser_3"
	power = -75

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 6
	}

	count = @ESC_STRIKECRAFT_count_large
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 8 max = 23 }
	cooldown = 2.3
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	health = 15
	armor = 0
	shield = 25

	tracking = @ESC_STRIKECRAFT_tracking_fighter
	evasion = @ESC_STRIKECRAFT_evasion
	speed = @ESC_STRIKECRAFT_speed_4
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter

	hull_damage = @ESC_WEAPON_archaeo_crafts_hull_damage
	armor_damage = @ESC_WEAPON_archaeo_crafts_armor_damage
	armor_penetration = @ESC_WEAPON_archaeo_crafts_armor_penetration
	shield_damage = @ESC_WEAPON_archaeo_crafts_shield_damage
	shield_penetration = @ESC_WEAPON_archaeo_crafts_shield_penetration

	ship_behavior = "fighters_behavior"
	component_set = ESC_BIO_ARCHAEO_STRIKECRAFT_2
	prerequisites = { "esc_tech_archaeo_strikecraft_2" }
	tags = { weapon_type_strike_craft weapon_archaeotech }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }
	upgrades_to = ESC_BIO_ARCHAEO_STRIKECRAFT_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##         Advanced Tech-Synthetic Drone Crafts           ##
############################################################

strike_craft_component_template = {
	key = ESC_ARCHAEO_STRIKECRAFT_3
	size = LARGE
	entity = "bomber_entity"
	icon = GFX_esc_archaeo_strikecraft_3
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "strike_craft_laser_3"
	power = -80

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
	}

	count = @ESC_STRIKECRAFT_count_large
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 10 max = 30 }
	cooldown = 2.3
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	health = 20
	armor = 0
	shield = 30

	tracking = @ESC_STRIKECRAFT_tracking_fighter
	evasion = @ESC_STRIKECRAFT_evasion
	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter

	hull_damage = @ESC_WEAPON_archaeo_crafts_hull_damage
	armor_damage = @ESC_WEAPON_archaeo_crafts_armor_damage
	armor_penetration = @ESC_WEAPON_archaeo_crafts_armor_penetration
	shield_damage = @ESC_WEAPON_archaeo_crafts_shield_damage
	shield_penetration = @ESC_WEAPON_archaeo_crafts_shield_penetration

	ship_behavior = "fighters_behavior"
	component_set = ESC_ARCHAEO_STRIKECRAFT_3
	prerequisites = { "esc_tech_archaeo_strikecraft_3" }
	tags = { weapon_type_strike_craft weapon_archaeotech }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

strike_craft_component_template = {
	key = ESC_BIO_ARCHAEO_STRIKECRAFT_3
	size = LARGE
	entity = "space_amoeba_small_entity"
	icon = GFX_esc_bio_archaeo_strikecraft_3
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "strike_craft_laser_3"
	power = -80

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
	}

	count = @ESC_STRIKECRAFT_count_large
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 10 max = 30 }
	cooldown = 2.3
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	health = 20
	armor = 0
	shield = 30

	tracking = @ESC_STRIKECRAFT_tracking_fighter
	evasion = @ESC_STRIKECRAFT_evasion
	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter

	hull_damage = @ESC_WEAPON_archaeo_crafts_hull_damage
	armor_damage = @ESC_WEAPON_archaeo_crafts_armor_damage
	armor_penetration = @ESC_WEAPON_archaeo_crafts_armor_penetration
	shield_damage = @ESC_WEAPON_archaeo_crafts_shield_damage
	shield_penetration = @ESC_WEAPON_archaeo_crafts_shield_penetration

	ship_behavior = "fighters_behavior"
	component_set = ESC_BIO_ARCHAEO_STRIKECRAFT_3
	prerequisites = { "esc_tech_archaeo_strikecraft_3" }
	tags = { weapon_type_strike_craft weapon_archaeotech }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

############################################################
##                Tech-Synthetic Ruinator                 ##
############################################################

# titan
weapon_component_template = {
	key = ESC_ARCHAEO_TITANLASER_2
	size = titanic
	icon = GFX_esc_archaeo_titan_laser_2
	icon_frame = 1
	type = instant
	prio_projectile = yes

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5750
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 15 max = 60 }
	total_fire_time = 90
	range = @ESC_WEAPON_RANGE_L_6
	accuracy = 0.85
	power = -525

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
	}

	hull_damage = @ESC_WEAPON_archaeo_titanic_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_titanic_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_titanic_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_titanic_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_titanic_shield_damage
	tracking = 0

	firing_arc = 25.0
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_archaeo_titanic_2" }
	component_set = ESC_ARCHAEO_TITANLASER_2
	projectile_gfx = "perdition_beam"
	tags = { weapon_type_energy weapon_archaeotech weapon_role_artillery t_slot }
	ai_tags = { weapon_role_artillery weapon_role_anti_armor artillery }
	upgrades_to = ESC_ARCHAEO_TITANLASER_3

	# arkship T-slot weapons use different damage valuess
	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# juggernaut
weapon_component_template = {
	key = ESC_ARCHAEO_TITANLASER_2_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_archaeo_titan_laser_2
	icon_frame = 1
	type = instant
	prio_projectile = yes

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5750
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 15 max = 60 }
	total_fire_time = 90
	range = @ESC_WEAPON_RANGE_L_6
	accuracy = 0.85
	power = -525

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
	}

	hull_damage = @ESC_WEAPON_archaeo_titanic_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_titanic_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_titanic_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_titanic_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_titanic_shield_damage
	tracking = 0

	firing_arc = 25.0
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_archaeo_titanic_2" }
	component_set = ESC_ARCHAEO_TITANLASER_2_JUGGERNAUT
	projectile_gfx = "perdition_beam"
	tags = { weapon_type_energy weapon_archaeotech weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_armor artillery }
	upgrades_to = ESC_ARCHAEO_TITANLASER_3_JUGGERNAUT

	potential = {
		ESC_ship_uses_juggernaut_components = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# arkship
weapon_component_template = {
	key = ESC_ARCHAEO_TITANLASER_2_ARKSHIP
	size = titanic
	icon = GFX_esc_archaeo_titan_laser_2
	icon_frame = 1
	type = instant
	prio_projectile = yes

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5500
		MAX_DAMAGE = 15000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 15 max = 60 }
	total_fire_time = 90
	range = @ESC_WEAPON_RANGE_ARKSHIP_4
	accuracy = 0.75
	power = 0

	resources = {
		category = ship_components
		upkeep = {
			alloys = @titanic_t7_upkeep_alloys
			energy = @titanic_t7_upkeep_energy
		}
	}

	hull_damage = @ESC_WEAPON_archaeo_titanic_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_titanic_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_titanic_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_titanic_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_titanic_shield_damage
	tracking = 0

	firing_arc = 25.0
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_archaeo_titanic_2" }
	component_set = ESC_ARCHAEO_TITANLASER_2_ARKSHIP
	projectile_gfx = "perdition_beam"
	tags = { weapon_type_energy weapon_archaeotech weapon_role_artillery t_slot }
	ai_tags = { weapon_role_artillery weapon_role_anti_armor artillery }
	upgrades_to = ESC_ARCHAEO_TITANLASER_3_ARKSHIP

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
	}
}

############################################################
##           Advanced Tech-Synthetic Ruinator             ##
############################################################

# titan
weapon_component_template = {
	key = ESC_ARCHAEO_TITANLASER_3
	size = titanic
	icon = GFX_esc_archaeo_titan_laser_3
	icon_frame = 1
	type = instant
	prio_projectile = yes

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 6500
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 15 max = 60 }
	total_fire_time = 90
	range = @ESC_WEAPON_RANGE_G_4
	accuracy = 0.85
	power = -550

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 7
	}

	hull_damage = @ESC_WEAPON_archaeo_titanic_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_titanic_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_titanic_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_titanic_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_titanic_shield_damage
	tracking = 0

	firing_arc = 25.0
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_archaeo_titanic_3" }
	component_set = ESC_ARCHAEO_TITANLASER_3
	projectile_gfx = "perdition_beam"
	tags = { weapon_type_energy weapon_archaeotech weapon_role_artillery t_slot }
	ai_tags = { weapon_role_artillery weapon_role_anti_armor artillery }

	# arkship T-slot weapons use different damage valuess
	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# juggernaut
weapon_component_template = {
	key = ESC_ARCHAEO_TITANLASER_3_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_archaeo_titan_laser_3
	icon_frame = 1
	type = instant
	prio_projectile = yes

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 6500
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 15 max = 60 }
	total_fire_time = 90
	range = @ESC_WEAPON_RANGE_G_4
	accuracy = 0.85
	power = -550

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 7
	}

	hull_damage = @ESC_WEAPON_archaeo_titanic_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_titanic_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_titanic_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_titanic_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_titanic_shield_damage
	tracking = 0

	firing_arc = 25.0
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_archaeo_titanic_3" }
	component_set = ESC_ARCHAEO_TITANLASER_3_JUGGERNAUT
	projectile_gfx = "perdition_beam"
	tags = { weapon_type_energy weapon_archaeotech weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_armor artillery }

	potential = {
		ESC_ship_uses_juggernaut_components = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = {
					resource = minor_artifacts
					value < 3
				}
			}
		}
		modifier = {
			factor = 1.3
			owner = {
				resource_stockpile_compare = {
					resource = minor_artifacts
					value > 250
				}
			}
		}
	}
}

# arkship
weapon_component_template = {
	key = ESC_ARCHAEO_TITANLASER_3_ARKSHIP
	size = titanic
	icon = GFX_esc_archaeo_titan_laser_3
	icon_frame = 1
	type = instant
	prio_projectile = yes

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 6000
		MAX_DAMAGE = 16000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 15 max = 60 }
	total_fire_time = 90
	range = @ESC_WEAPON_RANGE_ARKSHIP_4
	accuracy = 0.75
	power = 0

	resources = {
		category = ship_components
		upkeep = {
			alloys = @titanic_t7_upkeep_alloys
			energy = @titanic_t7_upkeep_energy
		}
	}

	hull_damage = @ESC_WEAPON_archaeo_titanic_hull_damage
	armor_penetration = @ESC_WEAPON_archaeo_titanic_armor_penetration
	armor_damage = @ESC_WEAPON_archaeo_titanic_armor_damage
	shield_penetration = @ESC_WEAPON_archaeo_titanic_shield_penetration
	shield_damage = @ESC_WEAPON_archaeo_titanic_shield_damage
	tracking = 0

	firing_arc = 25.0
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_archaeo_titanic_3" }
	component_set = ESC_ARCHAEO_TITANLASER_3_ARKSHIP
	projectile_gfx = "perdition_beam"
	tags = { weapon_type_energy weapon_archaeotech weapon_role_artillery t_slot }
	ai_tags = { weapon_role_artillery weapon_role_anti_armor artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 0
		modifier = {
			add = 2.5
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
	}
}

############################################################
##                 Tech-Synthetic Armor                   ##
############################################################

# small
utility_component_template = {
	key = SMALL_ESC_ARCHAEO_ARMOR_2
	size = small
	icon = GFX_esc_archaeo_armor_2
	icon_frame = 1
	power = @power_S4

	modifier = {
		ship_armor_add = @armor_S4
		ship_shield_add = @shield_S2
		ship_shield_regen_add_static = @regen_S4
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	custom_tooltip = tt_SMALL_ARCHAEO_ARMOR_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S2
		ship_shield_regen_add_static = @regen_S2
	}

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = s
		TIER = 6
	}

	prerequisites = { "esc_tech_archaeoarmor_2" }
	component_set = ESC_ARCHAEO_ARMOR_2
	upgrades_to = SMALL_ESC_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

utility_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_ARMOR_2
	size = small
	icon = GFX_esc_bio_archaeo_armor_2
	icon_frame = 1
	power = @power_S4

	modifier = {
		ship_hull_add = @bio_ship_hull_s_4
		ship_armor_add = @armor_S4
		ship_shield_add = @shield_S2
		ship_shield_regen_add_static = @regen_S4
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S2
		ship_shield_regen_add_static = @regen_S2
	}
	triggered_ship_modifier = {
		potential = {
			has_armor_percentage < @bio_ship_armor_regen_threshold
		}
		ship_armor_regen_add_static = @bio_ship_armor_regen_s_4
	}
	custom_tooltip = esc_tooltip_bioship_armor

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = s
		TIER = 6
	}

	prerequisites = { "esc_tech_archaeoarmor_2" }
	component_set = ESC_BIO_ARCHAEO_ARMOR_2
	upgrades_to = SMALL_ESC_BIO_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

# medium
utility_component_template = {
	key = MEDIUM_ESC_ARCHAEO_ARMOR_2
	size = medium
	icon = GFX_esc_archaeo_armor_2
	icon_frame = 1
	power = @power_M4

	modifier = {
		ship_armor_add = @armor_M4
		ship_shield_add = @shield_M2
		ship_shield_regen_add_static = @regen_M4
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	custom_tooltip = tt_MEDIUM_ARCHAEO_ARMOR_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M2
		ship_shield_regen_add_static = @regen_M2
	}

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = m
		TIER = 6
	}

	prerequisites = { "esc_tech_archaeoarmor_2" }
	component_set = ESC_ARCHAEO_ARMOR_2
	upgrades_to = MEDIUM_ESC_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

utility_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_ARMOR_2
	size = medium
	icon = GFX_esc_bio_archaeo_armor_2
	icon_frame = 1
	power = @power_M4

	modifier = {
		ship_hull_add = @bio_ship_hull_m_4
		ship_armor_add = @armor_M4
		ship_shield_add = @shield_M2
		ship_shield_regen_add_static = @regen_M4
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M2
		ship_shield_regen_add_static = @regen_M2
	}
	triggered_ship_modifier = {
		potential = {
			has_armor_percentage < @bio_ship_armor_regen_threshold
		}
		ship_armor_regen_add_static = @bio_ship_armor_regen_m_4
	}
	custom_tooltip = esc_tooltip_bioship_armor

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = m
		TIER = 6
	}

	prerequisites = { "esc_tech_archaeoarmor_2" }
	component_set = ESC_BIO_ARCHAEO_ARMOR_2
	upgrades_to = MEDIUM_ESC_BIO_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

# large
utility_component_template = {
	key = LARGE_ESC_ARCHAEO_ARMOR_2
	size = large
	icon = GFX_esc_archaeo_armor_2
	icon_frame = 1
	power = @power_L4

	modifier = {
		ship_armor_add = @armor_L4
		ship_shield_add = @shield_L2
		ship_shield_regen_add_static = @regen_L4
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	custom_tooltip = tt_LARGE_ARCHAEO_ARMOR_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L2
		ship_shield_regen_add_static = @regen_L2
	}

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = l
		TIER = 6
	}

	prerequisites = { "esc_tech_archaeoarmor_2" }
	component_set = ESC_ARCHAEO_ARMOR_2
	upgrades_to = LARGE_ESC_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

utility_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_ARMOR_2
	size = large
	icon = GFX_esc_bio_archaeo_armor_2
	icon_frame = 1
	power = @power_L4

	modifier = {
		ship_hull_add = @bio_ship_hull_l_4
		ship_armor_add = @armor_L4
		ship_shield_add = @shield_L2
		ship_shield_regen_add_static = @regen_L4
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L2
		ship_shield_regen_add_static = @regen_L2
	}
	triggered_ship_modifier = {
		potential = {
			has_armor_percentage < @bio_ship_armor_regen_threshold
		}
		ship_armor_regen_add_static = @bio_ship_armor_regen_l_4
	}
	custom_tooltip = esc_tooltip_bioship_armor

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = l
		TIER = 6
	}

	prerequisites = { "esc_tech_archaeoarmor_2" }
	component_set = ESC_BIO_ARCHAEO_ARMOR_2
	upgrades_to = LARGE_ESC_BIO_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

############################################################
##              Advanced Tech-Synthetic Armor             ##
############################################################

# small
utility_component_template = {
	key = SMALL_ESC_ARCHAEO_ARMOR_3
	size = small
	icon = GFX_esc_archaeo_armor_3
	icon_frame = 1
	power = @power_S5

	modifier = {
		ship_armor_add = @armor_S5
		ship_shield_add = @shield_S3
		ship_shield_regen_add_static = @regen_S5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	custom_tooltip = tt_SMALL_ARCHAEO_ARMOR_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S3
		ship_shield_regen_add_static = @regen_S3
	}

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = s
		TIER = 7
	}

	prerequisites = { "esc_tech_archaeoarmor_3" }
	component_set = ESC_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

utility_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_ARMOR_3
	size = small
	icon = GFX_esc_bio_archaeo_armor_3
	icon_frame = 1
	power = @power_S5

	modifier = {
		ship_hull_add = @bio_ship_hull_s_5
		ship_armor_add = @armor_S5
		ship_shield_add = @shield_S3
		ship_shield_regen_add_static = @regen_S5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S3
		ship_shield_regen_add_static = @regen_S3
	}
	triggered_ship_modifier = {
		potential = {
			has_armor_percentage < @bio_ship_armor_regen_threshold
		}
		ship_armor_regen_add_static = @bio_ship_armor_regen_s_5
	}
	custom_tooltip = esc_tooltip_bioship_armor

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = s
		TIER = 7
	}

	prerequisites = { "esc_tech_archaeoarmor_3" }
	component_set = ESC_BIO_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

# medium
utility_component_template = {
	key = MEDIUM_ESC_ARCHAEO_ARMOR_3
	size = medium
	icon = GFX_esc_archaeo_armor_3
	icon_frame = 1
	power = @power_M5

	modifier = {
		ship_armor_add = @armor_M5
		ship_shield_add = @shield_M3
		ship_shield_regen_add_static = @regen_M5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	custom_tooltip = tt_MEDIUM_ARCHAEO_ARMOR_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M3
		ship_shield_regen_add_static = @regen_M3
	}

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = m
		TIER = 7
	}

	prerequisites = { "esc_tech_archaeoarmor_3" }
	component_set = ESC_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

utility_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_ARMOR_3
	size = medium
	icon = GFX_esc_bio_archaeo_armor_3
	icon_frame = 1
	power = @power_M5

	modifier = {
		ship_hull_add = @bio_ship_hull_m_5
		ship_armor_add = @armor_M5
		ship_shield_add = @shield_M3
		ship_shield_regen_add_static = @regen_M5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M3
		ship_shield_regen_add_static = @regen_M3
	}
	triggered_ship_modifier = {
		potential = {
			has_armor_percentage < @bio_ship_armor_regen_threshold
		}
		ship_armor_regen_add_static = @bio_ship_armor_regen_m_5
	}
	custom_tooltip = esc_tooltip_bioship_armor

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = m
		TIER = 7
	}

	prerequisites = { "esc_tech_archaeoarmor_3" }
	component_set = ESC_BIO_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

# large
utility_component_template = {
	key = LARGE_ESC_ARCHAEO_ARMOR_3
	size = large
	icon = GFX_esc_archaeo_armor_3
	icon_frame = 1
	power = @power_L5

	modifier = {
		ship_armor_add = @armor_L5
		ship_shield_add = @shield_L3
		ship_shield_regen_add_static = @regen_L5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	custom_tooltip = tt_LARGE_ARCHAEO_ARMOR_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L3
		ship_shield_regen_add_static = @regen_L3
	}

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = l
		TIER = 7
	}

	prerequisites = { "esc_tech_archaeoarmor_3" }
	component_set = ESC_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

utility_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_ARMOR_3
	size = large
	icon = GFX_esc_bio_archaeo_armor_3
	icon_frame = 1
	power = @power_L5

	modifier = {
		ship_hull_add = @bio_ship_hull_l_5
		ship_armor_add = @armor_L5
		ship_shield_add = @shield_L3
		ship_shield_regen_add_static = @regen_L5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
		ship_shield_hardening_add = @hardening_T6
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L3
		ship_shield_regen_add_static = @regen_L3
	}
	triggered_ship_modifier = {
		potential = {
			has_armor_percentage < @bio_ship_armor_regen_threshold
		}
		ship_armor_regen_add_static = @bio_ship_armor_regen_l_5
	}
	custom_tooltip = esc_tooltip_bioship_armor

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = ARMOR
		SIZE = l
		TIER = 7
	}

	prerequisites = { "esc_tech_archaeoarmor_3" }
	component_set = ESC_BIO_ARCHAEO_ARMOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 1.5
	}
}

############################################################
##                Tech-Synthetic Shields                  ##
############################################################

# small
utility_component_template = {
	key = SMALL_ESC_ARCHAEO_SHIELDS_2
	size = small
	icon = GFX_esc_archaeo_shield_2
	icon_frame = 1
	power = @power_S6

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = s
		TIER = 6
	}

	modifier = {
		ship_shield_add = @shield_S4
		ship_shield_regen_add_static = @regen_S7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	custom_tooltip = tt_SMALL_ARCHAEO_SHIELD_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S2
		ship_shield_regen_add_static = @regen_S2
	}

	prerequisites = { "esc_tech_archaeoshield_2" }
	component_set = ESC_ARCHAEO_SHIELDS_2
	upgrades_to = SMALL_ESC_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

utility_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_SHIELDS_2
	size = small
	icon = GFX_esc_bio_archaeo_shield_2
	icon_frame = 1
	power = @power_S6

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = s
		TIER = 6
	}

	modifier = {
		ship_shield_add = @shield_S4
		ship_shield_regen_add_static = @regen_S7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S2
		ship_shield_regen_add_static = @regen_S2
	}

	prerequisites = { "esc_tech_archaeoshield_2" }
	component_set = ESC_BIO_ARCHAEO_SHIELDS_2
	upgrades_to = SMALL_ESC_BIO_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

# medium
utility_component_template = {
	key = MEDIUM_ESC_ARCHAEO_SHIELDS_2
	size = medium
	icon = GFX_esc_archaeo_shield_2
	icon_frame = 1
	power = @power_M6

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = m
		TIER = 6
	}

	modifier = {
		ship_shield_add = @shield_M4
		ship_shield_regen_add_static = @regen_M7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	custom_tooltip = tt_MEDIUM_ARCHAEO_SHIELD_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M2
		ship_shield_regen_add_static = @regen_M2
	}

	prerequisites = { "esc_tech_archaeoshield_2" }
	component_set = ESC_ARCHAEO_SHIELDS_2
	upgrades_to = MEDIUM_ESC_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

utility_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_SHIELDS_2
	size = medium
	icon = GFX_esc_bio_archaeo_shield_2
	icon_frame = 1
	power = @power_M6

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = m
		TIER = 6
	}

	modifier = {
		ship_shield_add = @shield_M4
		ship_shield_regen_add_static = @regen_M7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M2
		ship_shield_regen_add_static = @regen_M2
	}

	prerequisites = { "esc_tech_archaeoshield_2" }
	component_set = ESC_BIO_ARCHAEO_SHIELDS_2
	upgrades_to = MEDIUM_ESC_BIO_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

# large
utility_component_template = {
	key = LARGE_ESC_ARCHAEO_SHIELDS_2
	size = large
	icon = GFX_esc_archaeo_shield_2
	icon_frame = 1
	power = @power_L6

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = l
		TIER = 6
	}

	modifier = {
		ship_shield_add = @shield_L4
		ship_shield_regen_add_static = @regen_L7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	custom_tooltip = tt_LARGE_ARCHAEO_SHIELD_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L2
		ship_shield_regen_add_static = @regen_L2
	}

	prerequisites = { "esc_tech_archaeoshield_2" }
	component_set = ESC_ARCHAEO_SHIELDS_2
	upgrades_to = LARGE_ESC_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

utility_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_SHIELDS_2
	size = large
	icon = GFX_esc_bio_archaeo_shield_2
	icon_frame = 1
	power = @power_L6

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = l
		TIER = 6
	}

	modifier = {
		ship_shield_add = @shield_L4
		ship_shield_regen_add_static = @regen_L7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L2
		ship_shield_regen_add_static = @regen_L2
	}

	prerequisites = { "esc_tech_archaeoshield_2" }
	component_set = ESC_BIO_ARCHAEO_SHIELDS_2
	upgrades_to = LARGE_ESC_BIO_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

############################################################
##           Advanced Tech-Synthetic Shields              ##
############################################################

# small
utility_component_template = {
	key = SMALL_ESC_ARCHAEO_SHIELDS_3
	size = small
	icon = GFX_esc_archaeo_shield_3
	icon_frame = 1
	power = @power_S7

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = s
		TIER = 7
	}

	modifier = {
		ship_shield_add = @shield_S5
		ship_shield_regen_add_static = @regen_S7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	custom_tooltip = tt_SMALL_ARCHAEO_SHIELD_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S3
		ship_shield_regen_add_static = @regen_S3
	}

	prerequisites = { "esc_tech_archaeoshield_3" }
	component_set = ESC_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

utility_component_template = {
	key = SMALL_ESC_BIO_ARCHAEO_SHIELDS_3
	size = small
	icon = GFX_esc_bio_archaeo_shield_3
	icon_frame = 1
	power = @power_S7

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = s
		TIER = 7
	}

	modifier = {
		ship_shield_add = @shield_S5
		ship_shield_regen_add_static = @regen_S7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_S3
		ship_shield_regen_add_static = @regen_S3
	}

	prerequisites = { "esc_tech_archaeoshield_3" }
	component_set = ESC_BIO_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

# medium
utility_component_template = {
	key = MEDIUM_ESC_ARCHAEO_SHIELDS_3
	size = medium
	icon = GFX_esc_archaeo_shield_3
	icon_frame = 1
	power = @power_M7

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = m
		TIER = 7
	}

	modifier = {
		ship_shield_add = @shield_M5
		ship_shield_regen_add_static = @regen_M7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	custom_tooltip = tt_MEDIUM_ARCHAEO_SHIELD_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M2
		ship_shield_regen_add_static = @regen_M2
	}

	prerequisites = { "esc_tech_archaeoshield_3" }
	component_set = ESC_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

utility_component_template = {
	key = MEDIUM_ESC_BIO_ARCHAEO_SHIELDS_3
	size = medium
	icon = GFX_esc_bio_archaeo_shield_3
	icon_frame = 1
	power = @power_M7

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = m
		TIER = 7
	}

	modifier = {
		ship_shield_add = @shield_M5
		ship_shield_regen_add_static = @regen_M7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_M3
		ship_shield_regen_add_static = @regen_M3
	}

	prerequisites = { "esc_tech_archaeoshield_3" }
	component_set = ESC_BIO_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

# large
utility_component_template = {
	key = LARGE_ESC_ARCHAEO_SHIELDS_3
	size = large
	icon = GFX_esc_archaeo_shield_3
	icon_frame = 1
	power = @power_L7

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = l
		TIER = 7
	}

	modifier = {
		ship_shield_add = @shield_L5
		ship_shield_regen_add_static = @regen_L7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	custom_tooltip = tt_LARGE_ARCHAEO_SHIELD_AP
	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L3
		ship_shield_regen_add_static = @regen_L3
	}

	prerequisites = { "esc_tech_archaeoshield_3" }
	component_set = ESC_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}

utility_component_template = {
	key = LARGE_ESC_BIO_ARCHAEO_SHIELDS_3
	size = large
	icon = GFX_esc_bio_archaeo_shield_3
	icon_frame = 1
	power = @power_L7

	inline_script = {
		script = component_costs/shorthands/esc_inlines_archaeotech_cost
		COMPONENT_TYPE = SHIELD
		SIZE = l
		TIER = 7
	}

	modifier = {
		ship_shield_add = @shield_L5
		ship_shield_regen_add_static = @regen_L7 #Regeneration per day
	}
	ship_modifier = {
		ship_shield_hardening_add = 0.15
	}

	triggered_ship_design_modifier = {
		potential = {
			exists = from
			from = {
				OR = {
					has_ascension_perk = ap_archaeoengineers
					is_country_type = synth_queen
				}
			}
		}
		ship_shield_add = @shield_L3
		ship_shield_regen_add_static = @regen_L3
	}

	prerequisites = { "esc_tech_archaeoshield_3" }
	component_set = ESC_BIO_ARCHAEO_SHIELDS_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	inline_script = {
		script = ship_components_general/esc_inlines_archaeo_ai_weight
		MULTIPLIER = 0
	}
}
