tech_gigas_stellar_manip_1 = { #Base, given by the AP, enables the whole mod also makes fusion supressor explosions give plasma
	cost = @tier5cost1
	area = physics
	tier = 5
	category = { particles }
	is_rare = yes
	weight = 0

	prereqfor_desc = {
		custom = {
			title = "basic_stellar_manip1"
			desc = "basic_stellar_manip1_desc"
		}
	}
	prereqfor_desc = {
		custom = {
			title = "basic_stellar_manip2"
			desc = "basic_stellar_manip2_desc"
		}
	}
	prereqfor_desc = {
		custom = {
			title = "basic_stellar_manip3"
			desc = "basic_stellar_manip3_desc"
		}
	}
}

tech_gigas_stellar_manip_2 = { #Enables Stellar Manip mega
	cost = @tier5cost2
	area = engineering
	tier = 5
	category = { materials }
	is_rare = yes
	weight = @tier5weight2

	prerequisites = { "tech_gigas_stellar_manip_1" }

	prereqfor_desc = {
		custom = {
			title = "advanced_stellar_manip1"
			desc = "advanced_stellar_manip1_desc"
		}
	}
	prereqfor_desc = {
		custom = {
			title = "advanced_stellar_manip2"
			desc = "advanced_stellar_manip2_desc"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
		
		}
	}

	ai_weight = {
		factor = 3
		modifier = {
			factor = 1.25
			
		}
	}
}

tech_stellar_assembler = { #systemcraft assembler
	cost = 350000
	area = engineering
	tier = 5
	category = { voidcraft }
	is_rare = yes
	weight = @tier5weight3

	prerequisites = {
		"tech_gigas_stellar_manip_2"
		"giga_tech_war_system_6"
		"giga_tech_planet_assembly"
	}
	modifier = { 
		megastructure_build_speed_mult = 0.05
		country_resource_max_alloys_add = 500000
		country_resource_max_energy_add = 500000

	}
	prereqfor_desc = {
		custom = { title = "allow_star_assembly"	desc = "allow_star_assembly_desc" }
	}

	#copied the weights from systemcraft, idgaf
	weight_modifier = {
	
		modifier = { factor = 0 has_utopia = no }
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = 2
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = giga_tech_planetary_drive_yard }
			}
		}
		modifier = { factor = 0     has_global_flag = planetshipyard_disabled }
	}

	ai_weight = {
		factor = @giga_aiweight_multiplier
	
		modifier = { factor = 0 has_utopia = no }
		modifier = { factor = 0     has_global_flag = planetshipyard_disabled }
	}
}

tech_o_class_war_system = {
	cost = 500000
	area = physics
	tier = 5
	category = { field_manipulation }
	is_rare = yes
	prerequisites = { 
		giga_tech_war_system_6
		giga_tech_dyson_o_star
	}
	weight = 20
	prereqfor_desc = {
		custom = { title = "allow_o_class_war_system"	desc = "allow_o_class_war_system" }
	}

	weight_modifier = {
	
		modifier = {
			factor = 1.5
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = 0
			has_global_flag = giga_o_stars_disabled
		}
		modifier = {
			factor = 2
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = tech_o_class_war_system }
			}
		}
	}

	ai_weight = {
		factor = @giga_aiweight_multiplier
	
	}
}