# Acane Deciphering
tech_arcane_deciphering = {
	cost = @tier2cost3
	area = society
	tier = 2
	category = { archaeostudies }
	weight = @tier2weight3
	is_rare = yes

	feature_flags = {
		unlock_arcane_deciphering
	}

	weight_modifier = {
		factor = 0.50
		modifier = {
			factor = 0
			OR = {
				has_ancrel = no
				NOT = {
					has_resource = { type = minor_artifacts amount > 0 }
				}
			}
		}
		modifier = {
			factor = 0.50
			has_modifier = "curator_insight"
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_arcane_deciphering
		}
		modifier = {
			factor = 3
			has_trait_in_council = { TRAIT = leader_trait_curator }
		}
	}
}

tech_archeology_lab_ancrel = {
	area = society
	category = { archaeostudies }
	tier = 2
	cost = @tier2cost1
	is_reverse_engineerable = no
	is_rare = yes
	weight = @tier2weight1
	icon = "tech_archeology_lab"

	modifier = {
		ship_archaeological_site_clues_add = 2
	}

	weight_modifier = {
		modifier = {
			factor = 0.50
			has_modifier = "curator_insight"
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archeology_lab_ancrel
		}
		modifier = {
			factor = 3
			has_trait_in_council = { TRAIT = leader_trait_curator }
		}
		modifier = {
			factor = 0
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_modifier = "curator_insight"
			}
		}
	}

	prereqfor_desc = {
		component = {
			title = "TECH_UNLOCK_CURATOR_LAB_2_TITLE"
			desc = "TECH_UNLOCK_CURATOR_LAB_2_DESC"
		}
	}

	potential = {
		has_ancrel = yes
	}
}

#######################
# ARCHAEOTECHNOLOGIES
#######################

tech_archaeostudies = {
	cost = @tier2cost1
	area = society
	category = { archaeostudies }
	tier = 2
	is_rare = yes
	weight = @tier2weight3

	potential = {
		has_ancrel = yes
	}

	technology_swap = {
		name = tech_archaeostudies_wilderness
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_wilderness_empire = yes
		}
		modifier = {
			planet_biologists_minor_artifacts_produces_add = 0.1
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeostudies
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		modifier = {
			factor = 0.3
			count_archaeological_site = {
				count < 3
				limit = {
					is_site_completed = yes
				}
			}
		}
		modifier = {
			factor = 3
			OR = {
				has_country_flag = origin_shoulders_closure
				has_completed_precursor_research = yes
			}
		}
	}
}

#################
# Secrets of ...
#################

tech_secrets_cybrex = {
	cost = @tier4cost3
	area = society
	category = { archaeostudies }
	tier = 4
	is_rare = yes
	weight = 0

	potential = {
		has_ancrel = yes
	}
}

tech_secrets_league = {
	cost = @tier4cost3
	area = society
	category = { archaeostudies }
	tier = 4
	is_rare = yes
	weight = 0

	potential = {
		has_ancrel = yes
	}
}

tech_secrets_irassian = {
	cost = @tier4cost3
	area = society
	category = { archaeostudies }
	tier = 4
	is_rare = yes
	weight = 0

	potential = {
		has_ancrel = yes
	}
}

tech_secrets_vultaum = {
	cost = @tier4cost3
	area = society
	category = { archaeostudies }
	tier = 4
	is_rare = yes
	weight = 0

	potential = {
		has_ancrel = yes
	}
}

tech_secrets_yuht = {
	cost = @tier4cost3
	area = society
	category = { archaeostudies }
	tier = 4
	is_rare = yes
	weight = 0

	potential = {
		has_ancrel = yes
	}
}

tech_secrets_baol = {
	cost = @tier4cost3
	area = society
	category = { archaeostudies }
	tier = 4
	is_rare = yes
	weight = 0

	potential = {
		has_ancrel = yes
	}
}

tech_secrets_zroni = {
	cost = @tier4cost3
	area = society
	category = { archaeostudies }
	tier = 4
	is_rare = yes
	weight = 0

	potential = {
		has_ancrel = yes
	}
}

##################
# Ship Components
##################

tech_archaeoshield = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

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

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeoshield
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = "ai/shield_preference_weight"
	}
}

tech_archaeoarmor = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

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

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeoarmor
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = "ai/armor_preference_weight"
	}
}

tech_archaeo_detection_scrambler = {
	cost = @tier4cost2
	area = society
	category = { archaeostudies }
	tier = 4
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier5weight3

	potential = {
		has_ancrel = yes
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_SCRAMBLER_TITLE"
			desc = "TECH_UNLOCK_SCRAMBLER_DESC"
		}
	}

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_detection_scrambler
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}
}

tech_archaeo_titan_beam = {
	cost = @tier4cost2
	area = society
	category = { archaeostudies }
	tier = 4
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_titan_beam
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_energy
		}
	}
}

tech_archaeo_pk_devolving_beam = {
	area = society
	cost = @tier5cost3
	tier = 5
	is_rare = yes
	is_reverse_engineerable = no
	category = { archaeostudies }
	weight = @tier5weight3

	potential = {
		host_has_dlc = "Apocalypse"
		has_ancrel = yes
	}

	weight_modifier = {
		factor = 0.50
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_pk_devolving_beam
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}
}

tech_archaeo_mass_drivers = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

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

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_mass_drivers
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_archaeo_lasers = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

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

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_lasers
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_energy
		}
	}
}

tech_archaeo_point_defence = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

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

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_point_defence
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_energy
		}
	}
}

tech_archaeo_missiles = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_missiles
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
}

tech_archaeo_mass_accelerator = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

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

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_mass_accelerator
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_archaeo_strike_crafts = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

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

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_strike_crafts
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}

	ai_weight = {
		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_strike_craft
		}
	}
}

########################
# Buildings and Modules
########################

tech_archaeo_rampart = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
		is_nomadic = no
	}

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_rampart
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}
}

tech_archaeo_overcharger = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
	}

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_overcharger
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}
}

tech_archaeo_refinery = {
	cost = @tier3cost3
	area = society
	category = { archaeostudies }
	tier = 3
	prerequisites = { "tech_archaeostudies" }
	is_rare = yes
	weight = @tier4weight3

	potential = {
		has_ancrel = yes
		is_wilderness_empire = no
	}

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archaeo_refinery
		}
		modifier = {
			factor = 0.1
			num_buildings = {
				type = building_archaeostudies_faculty
				value < 1
				disabled = no
				in_construction = no
			}
		}
		modifier = {
			factor = 0.1
			NOT = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		modifier = {
			factor = 0
			has_ancrel = no
		}
		inline_script = "technology/archaeotech_weight"
	}
}
