elec_fe_init = {
	usage = fallen_empire_init
#	flags = { empire_home_system }
	class = "sc_trinary_elec"
	asteroid_belt = {
		type = rocky_asteroid_belt
		radius = 230
	}
	init_effect = {
		create_fe_home_citadel = yes
		generate_home_system_resources = yes
		if = {
			limit = { is_inside_nebula = no }
			create_nebula = {
				name = "NAME_Elec_Nebula"
				radius = 25
			}
		}
	}
	planet = {
		class = pc_k_star
		size = 35
		orbit_distance = 0
		orbit_angle = 0
		flags = { has_megastructure cant_build_here }
		init_effect = {
			prevent_anomaly = yes
			create_ambient_object = {
				type = "space_storm_2"
				entity_offset_height = -30
				location = this
			}
			create_ambient_object = {
				type = "nebula_L3_entity"
				entity_offset_height = -5
				location = this
			}
		}
		change_orbit = 35
		planet = {
			name = "Nova"
			class = pc_elec_aurora
			starting_planet = yes
			has_ring = no
			orbit_angle = 180
			size = 25
			orbit_distance = 0
			flags = { elec_aurora_pc_normal_star }
			init_effect = {
				create_cluster = {
					id = fe_elec_cluster
					radius = 140
					center = this.solar_system
				}
				set_planet_flag = fallen_empire_world
				prevent_anomaly = yes
				set_owner = root
				set_controller = root
				set_capital = yes
				add_building = building_ancient_palace
				add_building = building_fe_dome
				add_building = building_fe_dome
				add_building = building_fe_dome
				add_building = building_fe_stronghold
				add_building = building_fe_stronghold
				add_building = building_fe_stronghold
				add_building = building_class_4_singularity
				add_building = building_class_4_singularity
				add_building = building_nano_forge
				add_building = building_nano_forge
				add_building = building_dimensional_fabricator
				while = {
					count = 10
					add_district = district_aurora_city
				}
				while = {
					count = 5
					add_district = district_aurora_energy
				}
				while = {
					count = 8
					add_district = district_aurora_industrial
				}
				while = {
					count = 2
					add_district = district_aurora_minerals
				}
				while = {
					count = 100
					create_pop = { species = owner_main_species }
				}
				create_elec_fe_starting_navy = yes
				create_elec_fe_fleet = yes
				create_elec_fe_fleet = yes
				while = {
					count = 20
					create_army = {
						name = random
						owner = root
						species = root
						type = "psionic_army"
					}
				}
			}
		}
	}
	change_orbit = 110
	planet = {
		class = pc_g_star
		flags = { has_megastructure }
		orbit_angle = { min = 150 max = 180 }
		size = { min = 25 max = 29 }
		init_effect = {
			prevent_anomaly = yes
			create_ambient_object = {
				type = "consecrated_planet_stage_2_object"
				entity_offset_height = -10
				location = this
			}
		}
		change_orbit = 55
		planet = {
			class = pc_gas_giant
			has_ring = no
			orbit_angle = 75
			size = 20
			orbit_distance = 0
			init_effect = { prevent_anomaly = yes }
		}
	}
	change_orbit = 10
	planet = {
		class = pc_g_star
		flags = { has_megastructure }
		orbit_angle = { min = 160 max = 180 }
		size = { min = 23 max = 26 }
		init_effect = {
			prevent_anomaly = yes
			create_ambient_object = {
				type = "consecrated_planet_stage_1_object"
				entity_offset_height = -10
				location = this
			}
		}
		change_orbit = 45
		planet = {
			class = pc_molten
			has_ring = yes
			orbit_angle = 280
			size = 17
			orbit_distance = 0
			init_effect = { prevent_anomaly = yes }
		}
	}
	change_orbit = 70
	planet = {
		class = pc_asteroid
		orbit_angle = { min = 90 max = 125 }
		count = 2
		size = 6
		orbit_distance = 0
		init_effect = { prevent_anomaly = yes }
	}
	neighbor_system = {
		distance = { min = 0 max = 50 }
		initializer = "elec_fe_init_2"
	}
	neighbor_system = {
		distance = { min = 0 max = 50 }
		initializer = "elec_fe_init_3"
	}
	neighbor_system = {
		distance = { min = 0 max = 50 }
		initializer = "elec_fe_init_4"
	}
	neighbor_system = {
		distance = { min = 0 max = 50 }
		initializer = "elec_fe_init_5"
	}
	neighbor_system = {
		distance = { min = 0 max = 50 }
		initializer = "elec_fe_init_6"
	}
}

elec_fe_init_2 = {
	usage = fallen_empire_init
	asteroid_belt = {
		type = rocky_asteroid_belt
		radius = 95
	}
	asteroid_belt = {
		type = rocky_asteroid_belt
		radius = 225
	}
	asteroid_belt = {
		type = rocky_asteroid_belt
		radius = 234
	}
	class = "sc_k"
	planet = {
		class = star
		size = 30
		orbit_distance = 0
		flags = { has_megastructure }
		init_effect = {
			prevent_anomaly = yes
			create_ambient_object = {
				type = "nebula_L3_entity"
				entity_offset_height = -5
				location = this
			}
		}
	}
	change_orbit = 30
	planet = {
		name = "Argon"
		class = pc_elec_aurora
		starting_planet = yes
		has_ring = no
		orbit_angle = 180
		size = 25
		orbit_distance = 0
		flags = { elec_aurora_pc_normal_star }
		init_effect = {
			prevent_anomaly = yes
			set_planet_flag = fallen_empire_world
			set_owner = ROOT
			add_building = building_ancient_palace
			add_building = building_fe_dome
			add_building = building_fe_dome
			add_building = building_class_4_singularity
			add_building = building_fe_stronghold
			add_building = building_fe_stronghold
			add_building = building_fe_stronghold
			while = {
				count = 3
				add_district = district_aurora_city
			}
			while = {
				count = 3
				add_district = district_aurora_energy
			}
			while = {
				count = 25
				create_pop = { species = owner_main_species }
			}
			while = {
				count = 20
				create_army = {
					name = random
					owner = root
					species = root
					type = "psionic_army"
				}
			}
		}
	}
	change_orbit = 47
	planet = {
		class = pc_molten
		orbit_angle = 100
		size = 12
		orbit_distance = 0
	}
	change_orbit = 45
	planet = {
		class = pc_broken
		has_ring = yes
		orbit_angle = 90
		size = 20
		orbit_distance = 0
		moon = {
			class = pc_molten
			orbit_angle = 45
			size = 7
			orbit_distance = 16
		}
	}
	change_orbit = 50
	planet = {
		class = pc_molten
		orbit_angle = 130
		size = 24
		orbit_distance = 0
		moon = {
			class = pc_barren
			orbit_angle = 255
			size = 8
			orbit_distance = 16
		}
	}
	init_effect = {
		generate_home_system_resources = yes	
		every_neighbor_system = { set_star_flag = empire_cluster }
		if = {
			limit = { any_system_planet = { is_owned_by = root } }
			create_fe_citadel = yes
		}
		else = { create_fe_outpost = yes }
	}
}

elec_fe_init_3 = {
	usage = fallen_empire_init
	asteroid_belt = {
		type = icy_asteroid_belt
		radius = 140
	}
	class = "sc_b"
	planet = {
		class = pc_b_star
		size = 30
		orbit_distance = 0
		init_effect = {
			prevent_anomaly = yes
			create_ambient_object = {
				type = "nebula_L10_entity"
				entity_offset_height = -5
				location = this
			}
			create_ambient_object = {
				type = "nebula_3"
				entity_offset_height = -5
				location = this
			}
		}
	}
	change_orbit = 80
	planet = {
		class = pc_gaia
		orbit_angle = 130
		size = 20
		orbit_distance = 0
		moon = {
			class = pc_barren_cold
			size = 10
			orbit_distance = 14
		}
	}
	init_effect = {
		every_neighbor_system = { set_star_flag = empire_cluster }
		create_fe_outpost = yes
	}
}

elec_fe_init_4 = {
	usage = fallen_empire_init
	class = "sc_f"
	planet = {
		class = pc_f_star
		size = 27
		orbit_distance = 0
		init_effect = { prevent_anomaly = yes }
	}
	change_orbit = 75
	planet = {
		class = pc_frozen
		orbit_angle = 45
		size = 17
		orbit_distance = 0
	}
	change_orbit = 35
	planet = {
		class = pc_barren_cold
		orbit_angle = 45
		size = 18
		orbit_distance = 0
		moon = {
			class = pc_barren
			size = 9
			orbit_distance = 12
		}
	}
	change_orbit = 35
	planet = {
		class = pc_gas_giant
		orbit_angle = 20
		size = 22
		orbit_distance = 0
	}
	change_orbit = 35
	planet = {
		class = pc_molten
		orbit_angle = 90
		size = 19
		orbit_distance = 0
	}
	change_orbit = 45
	planet = {
		class = pc_gas_giant
		orbit_angle = 130
		has_ring = no
		size = 22
		orbit_distance = 0
		moon = {
			class = pc_asteroid
			size = 2
			orbit_distance = 16
		}
	}
	init_effect = {
		every_neighbor_system = { set_star_flag = empire_cluster }
		create_fe_citadel = yes
		create_ambient_object = {
			type = "turbulent_nebula_1"
			entity_offset_height = -5
			location = this
		}
		create_ambient_object = {
			type = "turbulent_nebula_2"
			entity_offset_height = -5
			location = this
		}
		spawn_megastructure = {
			type = "dyson_sphere_1"
			graphical_culture = elec_exd_01
		}
		create_ambient_object = {
			type = "large_debris_object"
			location = solar_system
		}
		create_ambient_object = {
			type = "large_debris_object"
			location = solar_system
		}
		create_ambient_object = {
			type = "large_debris_object"
			location = solar_system
		}
		create_ambient_object = {
			type = "medium_debris_01_object"
			location = solar_system
		}
		create_ambient_object = {
			type = "medium_debris_02_object"
			location = solar_system
		}
		create_ambient_object = {
			type = "medium_debris_01_object"
			location = solar_system
		}
		create_ambient_object = {
			type = "medium_debris_02_object"
			location = solar_system
		}
		create_ambient_object = {
			type = "small_debris_object"
			location = solar_system
		}
	}
}

elec_fe_init_5 = {
	usage = fallen_empire_init
	asteroid_belt = {
		type = icy_asteroid_belt
		radius = 160
	}
	asteroid_belt = {
		type = icy_asteroid_belt
		radius = 167
	}
	class = "sc_m"
	planet = {
		class = pc_m_star
		size = 25
		orbit_distance = 0
		init_effect = {
			prevent_anomaly = yes
			create_ambient_object = {
				type = "turbulent_nebula_1"
				entity_offset_height = -5
				location = this
			}
		}
	}
	change_orbit = 65
	planet = {
		class = pc_shrouded
		orbit_angle = 0
		has_ring = yes
		size = 20
		orbit_distance = 0
		moon = {
			class = pc_toxic
			size = 10
			orbit_distance = 14
		}
	}
	change_orbit = 40
	planet = {
		class = pc_barren_cold
		orbit_angle = 160
		size = 20
		orbit_distance = 0
	}
	change_orbit = 40
	planet = {
		class = pc_asteroid
		count = 2
		orbit_angle = { min = 55 max = 100 }
		size = 4
		orbit_distance = 6
	}
	init_effect = {
		every_neighbor_system = { set_star_flag = empire_cluster }
		create_fe_citadel = yes
	}
}

elec_fe_init_6 = {
	usage = fallen_empire_init
	class = "sc_b"
	planet = {
		class = pc_b_star
		size = 25
		orbit_distance = 0
		flags = { has_megastructure }
		init_effect = {
			prevent_anomaly = yes
			create_ambient_object = {
				type = "turbulent_nebula_2"
				entity_offset_height = -5
				location = this
			}
			create_ambient_object = {
				type = "psi_storm_1"
				entity_offset_height = -20
				location = this
			}
			last_created_ambient_object = {
				set_location = {
					target = prev
					distance = 0
					angle = random
				}
			}
		}
	}
	change_orbit = 30
	planet = {
		name = "Helix Shroud"
		class = pc_elec_aurora
		starting_planet = yes
		has_ring = no
		orbit_angle = 180
		size = 20
		orbit_distance = 0
		flags = { elec_aurora_pc_normal_star }
		init_effect = {
			prevent_anomaly = yes
			set_planet_flag = fallen_empire_world
			set_owner = ROOT
			add_building = building_ancient_palace
			add_building = building_fe_dome
			add_building = building_fe_dome
			add_building = building_dimensional_fabricator
			add_building = building_fe_stronghold
			add_building = building_fe_stronghold
			add_building = building_fe_stronghold
			while = {
				count = 3
				add_district = district_aurora_city
			}
			while = {
				count = 3
				add_district = district_aurora_energy
			}
			while = {
				count = 25
				create_pop = { species = owner_main_species }
			}
			create_elec_fe_starting_navy = yes
			while = {
				count = 20
				create_army = {
					name = random
					owner = root
					species = root
					type = "psionic_army"
				}
			}
		}
	}
	change_orbit = 60
	planet = {
		class = pc_molten
		orbit_angle = 0
		size = 20
		orbit_distance = 0
	}
	change_orbit = 30
	planet = {
		class = pc_barren_cold
		orbit_angle = 90
		size = 20
		orbit_distance = 0
		moon = {
			class = pc_broken
			size = 11
			orbit_distance = 15
		}
	}
	change_orbit = 35
	planet = {
		class = pc_broken
		orbit_angle = 90
		has_ring = yes
		size = 18
		orbit_distance = 0
	}
	change_orbit = 45
	planet = {
		class = pc_barren_cold
		orbit_angle = 90
		has_ring = yes
		size = 15
		orbit_distance = 0
		moon = {
			class = pc_shattered
			size = 11
			orbit_distance = 12
		}
	}
	init_effect = {
		every_neighbor_system = { set_star_flag = empire_cluster }
		create_fe_citadel = yes
	}
}