##################
### TECH COSTS ###
##################
#If you change any of these, use replace in files so the values are the same across all files

@tier1cost1 = 240
@tier1cost2 = 360
@tier1cost3 = 480
@tier1cost4 = 600

@tier2cost1 = 900
@tier2cost2 = 1200
@tier2cost3 = 1500
@tier2cost4 = 1800

@tier3cost1 = 2320
@tier3cost2 = 2840
@tier3cost3 = 3360
@tier3cost4 = 3880

####################
### TECH WEIGHTS ###
####################

@tier1weight1 = 100
@tier1weight2 = 95
@tier1weight3 = 90
@tier1weight4 = 85

@tier2weight1 = 75
@tier2weight2 = 70
@tier2weight3 = 65
@tier2weight4 = 60

@tier3weight1 = 50
@tier3weight2 = 45
@tier3weight3 = 40
@tier3weight4 = 35

#######################################
######### STRATEGIC RESOURCES #########
#######################################

#############
# Clustered #
#############

#Garanthium Mining
tech_mine_garanthium = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { materials }	
	prerequisites = { "tech_mineral_processing_1" }
	weight = @tier1weight3
	
	weight_modifier = {
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
		modifier = {
			factor = 0
			NOT = {
				any_system_within_border = {
					is_in_cluster = resource_cluster_0 #Garanthium cluster
				}
			}
		}
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
}

#Lythuric Gas Refining
tech_lythuric_gas = {
	cost = @tier1cost3
	area = physics
	tier = 1
	category = { field_manipulation }
	prerequisites = { "tech_sensors_2" }
	weight = @tier1weight3
		
	## unlock see lythuric gas
	
	weight_modifier = {
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
		modifier = {
			factor = 0
			NOT = {
				any_system_within_border = {
					is_in_cluster = resource_cluster_1 #Lythuric cluster
				}
			}
		}
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_field_manipulation"
			}
		}
	}
}

#Engos Vapor Refining
tech_engos_vapor = {
	cost = @tier1cost3
	area = society
	tier = 1
	category = { biology }	
	prerequisites = { "tech_genome_mapping" }
	weight = @tier1weight3
	
	weight_modifier = {
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
		modifier = {
			factor = 0
			NOT = {
				any_system_within_border = {
					is_in_cluster = resource_cluster_2 #Engos cluster
				}
			}
		}
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = society
				has_trait = "leader_trait_expertise_biology"
			}
		}
	}
}

#Teldar Crystal Mining
tech_mine_teldar = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { materials }	
	prerequisites = { "tech_mineral_processing_1" }
	weight = @tier1weight3
	
	weight_modifier = {
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
		modifier = {
			factor = 0
			NOT = {
				any_system_within_border = {
					is_in_cluster = resource_cluster_3 #Teldar cluster
				}
			}
		}
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_particles"
			}
		}
	}
}



#Pitharan Dust Refining
tech_pitharan_dust = {
	cost = @tier1cost3
	area = society
	tier = 1
	category = { biology }	
	prerequisites = { "tech_genome_mapping" }
	weight = @tier1weight3
	
	weight_modifier = {
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
		modifier = {
			factor = 0
			NOT = {
				any_system_within_border = {
					is_in_cluster = resource_cluster_4 #Pitharan cluster
				}
			}
		}
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = society
				has_trait = "leader_trait_expertise_biology"
			}
		}
	}
}

#Orillium Extraction
tech_mine_orillium = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { materials }	
	prerequisites = { "tech_mineral_processing_1" }
	weight = @tier1weight3
	
	weight_modifier = {
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
		modifier = {
			factor = 0
			NOT = {
				any_system_within_border = {
					is_in_cluster = resource_cluster_5 #Orillium cluster
				}
			}
		}
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
}

#################
# Non-clustered #
#################

#Neutronium Extraction 
tech_mine_neutronium = {
	cost = @tier3cost3
	area = physics
	tier = 3
	category = { materials }
	prerequisites = { "tech_sensors_4" }
	weight = @tier3weight3
		
	## unlock see neutronium ore
	
	weight_modifier = {
		modifier = {
			factor = 1.5
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
}

#Living Metal
tech_mine_living_metal = {
	cost = @tier3cost4
	area = engineering
	tier = 3
	category = { materials }
	prerequisites = { "tech_space_construction" }
	weight = @tier3weight4
	
	weight_modifier = {
		factor = 0
	}
}

#Betharian Refining
tech_mine_betharian = {
	cost = @tier1cost2
	area = engineering
	tier = 1
	category = { industry }	
	prerequisites = { "tech_space_construction" }
	weight = @tier1weight2
	
	weight_modifier = {
		factor = 0.75
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_industry"
			}
		}	
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_industry"
			}
		}
	}	
}

tech_mine_zro = {
	cost = @tier2cost4
	area = physics
	tier = 2
	category = { psionics }
	is_rare = yes	
	prerequisites = { "tech_sensors_3" }
	weight = @tier2weight4
		
	## unlock see zro ore
	
	weight_modifier = {
		modifier = {
			factor = 0.10
			NOT = {
				research_leader = {
					area = physics
					OR = {
						has_trait = "leader_trait_expertise_materials"
						has_trait = "leader_trait_expertise_psionics"
					}
				}
			}
		}
		modifier = {
			factor = 2
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_psionics"
			}
		}
	}

	ai_weight = {
		factor = 3 #very rare tech
		modifier = {
			factor = 1.25
			research_leader = {
				area = society
				has_trait = "leader_trait_expertise_psionics"
			}
		}
	}
}

#Satramene Refining
tech_mine_satramene = {
	cost = @tier2cost1
	area = physics
	tier = 2
	category = { materials }	
	prerequisites = { "tech_sensors_3" }
	weight = @tier2weight1
	
	weight_modifier = {
		modifier = {
			factor = 2
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}	
	}
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
}

#Dark Matter Drawing
tech_mine_dark_matter = {
	cost = @tier3cost2
	area = physics
	tier = 3
	category = { field_manipulation }
	prerequisites = { "tech_sensors_4" }
	weight = @tier3weight2
		
	## unlock see dark matter
	
	weight_modifier = {
		modifier = {
			factor = 1.5
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}	
	
	ai_weight = {
		factor = 2 #strategic resource
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
}