oeo_ruined_factory_system = {
	class = "rl_standard_stars"
	usage = misc_system_init

	flags = { }

	usage_odds = {
		base = 0
		modifier = {
			host_has_dlc = "Utopia"
			add = 1000
		}
	}

	max_instances = 1
	scaled_spawn_chance = 4

	planet = {
		class = star
		orbit_distance = 0
	}

	change_orbit = 45

	planet = {
		class = "pc_shattered"
		size = 16
	}

	change_orbit = 25

	planet = {
		class = "pc_barren"
		size = { min = 10 max = 15 }
	}

	change_orbit = 25

	planet = {
		class = "pc_gas_giant"
		orbit_angle = { min = 90 max = 270 }
		size = 40

		init_effect = {
			save_event_target_as = oeo_factory_site_2
		}

		moon = {
			class = "pc_barren"
			size = 6
			orbit_distance = 20
			orbit_angle = { min = 90 max = 270 }
			has_ring = no

			init_effect = {
				save_event_target_as = oeo_factory_site_3
			}
		}
	}

	change_orbit = 25

	planet = {
		class = "pc_gas_giant"
		orbit_angle = { min = 90 max = 270 }
		size = 30

		init_effect = {
			save_event_target_as = oeo_factory_site_4
		}

		moon = {
			class = "pc_barren_cold"
			size = 6
			orbit_distance = 20
			orbit_angle = { min = 90 max = 270 }
			has_ring = no
			init_effect = {
				save_event_target_as = oeo_factory_site_5
			}
		}
		moon = {
			class = "pc_frozen"
			size = 6
			orbit_distance = 6
			orbit_angle = { min = 90 max = 270 }
			has_ring = no
			init_effect = {
				save_event_target_as = oeo_factory_site_6
			}
		}
		moon = {
			class = "pc_barren"
			size = 6
			orbit_distance = 6
			orbit_angle = { min = 90 max = 270 }
			has_ring = no

			init_effect = {
				save_event_target_as = oeo_factory_site_7
			}
		}
	}

	change_orbit = 25

	planet = {
		class = "pc_gas_giant"
		orbit_angle = { min = 90 max = 270 }
		size = 35

		init_effect = {
			save_event_target_as = oeo_factory_site_8
		}

		moon = {
			class = "pc_frozen"
			size = 6
			orbit_distance = 20
			orbit_angle = { min = 90 max = 270 }
			has_ring = no

		}
		moon = {
			class = "pc_frozen"
			size = 6
			orbit_distance = 6
			orbit_angle = { min = 90 max = 270 }
			has_ring = no

		}
	}

	change_orbit = 25

	planet = {
		class = "pc_frozen"
		size = { min = 10 max = 15 }

	}

	init_effect = {
		spawn_megastructure = {
			type = "oeo_industrial_station_ruined"
			planet = event_target:oeo_factory_site_2
		}
		spawn_megastructure = {
			type = "oeo_industrial_station_ruined"
			planet = event_target:oeo_factory_site_3
		}
		spawn_megastructure = {
			type = "oeo_industrial_station_ruined"
			planet = event_target:oeo_factory_site_4
		}
		spawn_megastructure = {
			type = "oeo_industrial_station_ruined"
			planet = event_target:oeo_factory_site_5
		}
		spawn_megastructure = {
			type = "oeo_industrial_station_ruined"
			planet = event_target:oeo_factory_site_6
		}
		spawn_megastructure = {
			type = "oeo_industrial_station_ruined"
			planet = event_target:oeo_factory_site_7
		}
		spawn_megastructure = {
			type = "oeo_industrial_station_ruined"
			planet = event_target:oeo_factory_site_8
		}
	}
}
