##################
### 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
@tier3cost5 = 4520
@tier3cost6 = 6100
@tier3cost5b =5260


####################
### 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

tech_ragnarok = {
	cost = @tier3cost6
	area = engineering
	tier = 3
	category = { voidcraft }	
	prerequisites = { "tech_ragnarok_doomsday_01" }
	weight = @tier3weight2
	is_rare = yes
		
	## unlock avatar	
	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_RAGNAROK_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_RAGNAROK_CONSTRUCTION_DESC"
		}
	}
	
	modifier = {
		max_minerals = 4000
		max_energy = 2000
	}
	
	feature_flags = { }
	
	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 120 }
		}	
		modifier = {
			factor = 2
			any_neighbor_country = {
				has_technology = tech_ragnarok
			}
		}
		modifier = {
			factor = 2
			years_passed > 120
		}
		modifier = {
			factor = 3
			years_passed > 130
		}
		modifier = {
			factor = 4
			years_passed > 140
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_voidcraft"
			}
		}
	}
	
	ai_weight = {
		factor = 240
	}
}

# Theory : Organic Technology Interfacing
tech_ragnarok_soc_01 = {
	cost = @tier3cost5b
	area = society
	tier = 3
	category = { biology }
	prerequisites = { "tech_ragnarok_eng_01" }
	weight = @tier3weight4
	is_rare = yes
	
	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_RAGNAROK_CHAIN_TITLE"
			desc = "TECH_UNLOCK_RAGNAROK_CHAIN_DESC"
		}
	}
	
	modifier = {		
		country_border_mult = 0.1
	}
	
	weight_modifier = {
		modifier = {
			factor = 1.5
			years_passed > 120
		}
		modifier = {
			factor = 2
			years_passed > 125
		}		
		modifier = {
			factor = 1.25
			research_leader = {
				area = society
				has_trait = "leader_trait_expertise_biology"
			}
		}
	}
		
	
	ai_weight = {
		factor = 120		
	}
}

# Theory : Organic Technology Integration
tech_ragnarok_soc_02 = {
	cost = @tier3cost5b
	area = society
	tier = 3
	category = { biology }
	prerequisites = { "tech_ragnarok_soc_01" }
	weight = @tier3weight4
	is_rare = yes
	
	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_RAGNAROK_CHAIN_TITLE"
			desc = "TECH_UNLOCK_RAGNAROK_CHAIN_DESC"
		}
	}
	
	modifier = { 		
		country_border_mult = 0.1
	}
	
	weight_modifier = {		
		modifier = {
			factor = 1.5
			years_passed > 120
		}
		modifier = {
			factor = 2
			years_passed > 125
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = society
				has_trait = "leader_trait_expertise_biology"
			}
		}
	}
	
	ai_weight = {
		factor = 120 #Good bonus		
	}
}

# Framework : Organic Technology
tech_ragnarok_eng_01 = {
	cost = @tier3cost6
	area = engineering
	tier = 3
	category = { materials }	
	prerequisites = { "tech_ragnarok_phy_01" }
	weight = @tier3weight4
	is_rare = yes
	
	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_RAGNAROK_CHAIN_TITLE"
			desc = "TECH_UNLOCK_RAGNAROK_CHAIN_DESC"
		}
	}
	
	modifier = {		
		tile_resource_energy_mult = 0.05
	}
	
	weight_modifier = {		
		modifier = {
			factor = 1.5
			years_passed > 120
		}
		modifier = {
			factor = 2
			years_passed > 125
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
	
	ai_weight = {
		factor = 40
		modifier = {
			factor = 3
			years_passed > 110
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
}

# Organic Core
tech_ragnarok_eng_02 = {
	cost = @tier3cost6
	area = engineering
	tier = 3
	category = { materials }	
	prerequisites = { "tech_ragnarok_eng_01" }
	weight = @tier3weight4
	is_rare = yes
	
	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_RAGNAROK_CHAIN_TITLE"
			desc = "TECH_UNLOCK_RAGNAROK_CHAIN_DESC"
		}
	}
	
	modifier = {
		tile_resource_energy_mult = 0.05		
	}
	
	weight_modifier = {
		modifier = {
			factor = 1.5
			years_passed > 120
		}
		modifier = {
			factor = 2
			years_passed > 125
		}	
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
	
	ai_weight = {
		factor = 40
		modifier = {
			factor = 3
			years_passed > 110
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = engineering
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
}

# Organic Structure Analysis
tech_ragnarok_phy_01 = {
	area = physics
	cost = @tier3cost6
	tier = 3
	category = { materials }
	ai_update_type = military
	prerequisites = { "tech_erebus" "tech_avatar_doomsday_01" }
	weight = @tier3weight4
	is_rare = yes
	
	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_RAGNAROK_CHAIN_TITLE"
			desc = "TECH_UNLOCK_RAGNAROK_CHAIN_DESC"
		}
	}
	
	modifier = {
		tile_resource_minerals_mult = 0.05
	}
	
	weight_modifier = {
		modifier = {
			factor = 1.5
			years_passed > 120
		}
		modifier = {
			factor = 2
			years_passed > 125
		}			
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_materials"
			}
		}
	}
	
	ai_weight = {
		factor = 40 #good component
		modifier = {
			factor = 3
			years_passed > 100
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_field_manipulation"
			}
		}
	}
}

# Theory : Organic Growth Manipulation
tech_ragnarok_phy_02 = {
	area = physics
	cost = @tier3cost5b
	tier = 3
	category = { field_manipulation }
	ai_update_type = military
	prerequisites = { "tech_ragnarok_phy_01" }
	weight = @tier3weight4
	is_rare = yes
	
	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_RAGNAROK_CHAIN_TITLE"
			desc = "TECH_UNLOCK_RAGNAROK_CHAIN_DESC"
		}
	}
	
	modifier = {
		tile_resource_minerals_mult = 0.05
	}
	
	weight_modifier = {
		modifier = {
			factor = 1.5
			years_passed > 120
		}
		modifier = {
			factor = 2
			years_passed > 125
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_field_manipulation"
			}
		}
	}
	
	ai_weight = {
		factor = 40
		modifier = {
			factor = 3
			years_passed > 110
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_field_manipulation"
			}
		}
	}
}

# Doomsday Weapon: Spear of Cassius
tech_ragnarok_doomsday_01 = {
	area = physics
	cost = @tier3cost6
	tier = 3
	category = { particles }
	ai_update_type = military
	prerequisites = { "tech_ragnarok_eng_02" "tech_ragnarok_phy_02" "tech_ragnarok_soc_02" }
	weight = @tier3weight4
	is_rare = yes
	
	modifier = {
		country_resource_influence_add = 1.0
	}
	
	weight_modifier = {
		modifier = {
			factor = 1.5
			years_passed > 125
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = physics
				has_trait = "leader_trait_expertise_particles"
			}
		}
	}
	
	ai_weight = {
		factor = 80		
	}
}