@EnigmaticEngineeringDraw = 0.025

# Dark Matter Deflectors
tech_dark_matter_deflector = {
	cost = @fallentechcost
	area = physics
	tier = @fallentechtier
	category = { field_manipulation }
	weight = 1
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_shields_5" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}

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

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

# Dark Matter Power Cores
tech_dark_matter_power_core = {
	cost = @fallentechcost
	area = physics
	tier = @fallentechtier
	category = { particles }
	weight = 1
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_zero_point_power" }

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_DARK_MATTER_POWER_TITLE"
			desc = "TECH_UNLOCK_DARK_MATTER_POWER_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_dark_matter_power_core
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_DARK_MATTER_POWER_TITLE"
				desc = "TECH_UNLOCK_BIO_DARK_MATTER_POWER_DESC"
			}
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}
}

# Dark Matter Thrusters
tech_dark_matter_propulsion = {
	cost = @fallentechcost
	area = engineering
	tier = @fallentechtier
	category = { propulsion }
	weight = 1
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_thrusters_4" }

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_DARK_MATTER_PROPULSION_TITLE"
			desc = "TECH_UNLOCK_DARK_MATTER_PROPULSION_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_thrusters_5
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_THRUSTER_5_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_THRUSTER_5_DESC"
			}
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}
}

tech_fe_affluence_1 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { industry }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_5
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_5 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_affluence_2 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { industry }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_affluence_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		modifier = {
			factor = 0
			country_uses_consumer_goods = no
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_affluence_2
		}
	}
}

tech_fe_nourishment_1 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_2
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_2 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
		modifier = {
			factor = 2
			country_uses_bio_ships = yes
		}
	}
}

tech_fe_nourishment_2 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_nourishment_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		modifier = {
			factor = 0
			country_uses_food = no
		}
		modifier = {
			factor = 2
			country_uses_bio_ships = yes
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_nourishment_2
		}
	}
}

tech_fe_fabricator_1 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { materials }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_4
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_4 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_fabricator_2 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { materials }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_fabricator_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_fabricator_2
		}
	}
}

tech_fe_singularity_1 = {
	area = physics
	cost = @fallentechcost
	tier = @fallentechtier
	category = { particles }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_2
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_2 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_singularity_2 = {
	area = physics
	cost = @fallentechcost
	tier = @fallentechtier
	category = { particles }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_singularity_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_singularity_2
		}
	}
}

tech_fe_forge_1 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { industry }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_5
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_5 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_forge_2 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { industry }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_forge_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_forge_2
		}
	}
}

tech_fe_dome_1 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_1
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_1 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_dome_2 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_dome_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_dome_2
		}
	}
}

tech_fe_fortress_1 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { military_theory }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_3
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_3 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_fortress_2 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { military_theory }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_fortress_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_fortress_2
		}
	}
}

tech_fe_administration_1 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_3
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_3 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_administration_2 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_administration_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_administration_2
		}
	}
}

tech_fe_assembly_1 = { #Not for Hives
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { industry }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = {
		OR = {
			tech_robomodding
			tech_robomodding_m
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0
			has_policy_flag = robots_outlawed
		}
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_4
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_4 }
		}
		modifier = {
			factor = 0
			is_hive_empire = yes
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_assembly_1
		}
	}
}

tech_fe_assembly_2 = { #Not for Hives
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { industry }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_assembly_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			has_policy_flag = robots_outlawed
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_assembly_2
		}
	}
}

tech_fe_clinic_1 = { #Not for Machines
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_4
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_4 }
		}
		modifier = {
			factor = 0
			is_machine_empire = yes
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_clinic_2 = { #Not for Machines
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_clinic_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_clinic_1
		}
	}
}

tech_fe_security_1 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_1
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_1 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_security_2 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_security_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_security_2
		}
	}
}

tech_fe_market_1 = { # Not for gestalt
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_3
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_3 }
		}
		modifier = {
			factor = 0
			is_gestalt = yes
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_market_2 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_market_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_market_2
		}
	}
}

tech_fe_silo_1 = {
	area = physics
	cost = @fallentechcost
	tier = @fallentechtier
	category = { field_manipulation }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_1
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_1 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_silo_2 = {
	area = physics
	cost = @fallentechcost
	tier = @fallentechtier
	category = { field_manipulation }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_silo_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_silo_2
		}
	}
}

tech_fe_entertainment_1 = { # Not for gestalt
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_4
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_4 }
		}
		modifier = {
			factor = 0
			is_gestalt = yes
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_entertainment_2 = { # Not for gestalt
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { statecraft }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_entertainment_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_entertainment_2
		}
	}
}

tech_fe_lab_1 = {
	area = physics
	cost = @fallentechcost
	tier = @fallentechtier
	category = { computing }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_5
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_5 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_lab_2 = {
	area = physics
	cost = @fallentechcost
	tier = @fallentechtier
	category = { computing }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_lab_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_lab_2
		}
	}
}

tech_fe_mine_1 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { materials }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_crisis_level = crisis_cosmogenesis_level_2
				has_ascension_perk = ap_enigmatic_engineering
			}
		}
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
			calc_true_if = {
				amount >= 4
				has_technology = tech_fe_affluence_1
				has_technology = tech_fe_nourishment_1
				has_technology = tech_fe_fabricator_1
				has_technology = tech_fe_singularity_1
				has_technology = tech_fe_forge_1
				has_technology = tech_fe_dome_1
				has_technology = tech_fe_fortress_1
				has_technology = tech_fe_administration_1
				has_technology = tech_fe_assembly_1
				has_technology = tech_fe_clinic_1
				has_technology = tech_fe_security_1
				has_technology = tech_fe_market_1
				has_technology = tech_fe_silo_1
				has_technology = tech_fe_entertainment_1
				has_technology = tech_fe_lab_1
				has_technology = tech_fe_mine_1
			}
		}
		modifier = {
			factor = @EnigmaticEngineeringDraw
			NOT = { has_crisis_level = crisis_cosmogenesis_level_2 }
		}
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_enigmatic_engineering
		}
		modifier = {
			factor = 2
			any_owned_planet = {
				is_planet_class = pc_cosmogenesis_world
				pop_amount > 5000
			}
		}
	}
}

tech_fe_mine_2 = {
	area = engineering
	cost = @fallentechcost
	tier = @fallentechtier
	category = { materials }
	weight = @tier5weight3
	is_rare = yes
	is_dangerous = yes

	prerequisites = { "tech_fe_mine_1" }

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = { has_ascension_perk = ap_cosmogenesis }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_fe_mine_2
		}
	}
}

### NEW TECHS SHOULD BE ADDED TO THE just_researched_fe_tech SCRIPTED TRIGGER
