namespace = f93_game_start
country_event = {
	id = f93_game_start.50
	hide_window = yes
	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		#log_error = "Nebula art event 50 on [GetDate] by [Root.GetName]"
		every_system = {
			limit = { is_inside_nebula = yes }
			nebula_cloaking_effect = yes
			# Class B
			if = {
				limit = {
					OR = {
						is_star_class = sc_b
						is_star_class = sc_binary_2
						is_star_class = sc_binary_5
						is_star_class = sc_trinary_2
						is_star_class = sc_trinary_4
					}
				}
				random_list = {
					20 = { create_nebula_3 = yes }
					20 = { create_nebula_4 = yes }
					10 = { create_rare_nebula_1 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_1 = yes
					}
				}
			}
			# Class A
			else_if = {
				limit = {
					OR = {
						is_star_class = sc_a
						is_star_class = sc_binary_1
						is_star_class = sc_binary_9
						is_star_class = sc_binary_10
					}
				}
				if = {
					limit = { has_star_flag = ocean_paradise_nebula }
					create_rare_nebula_1 = yes
				}
				else = {
					random_list = {
						20 = { create_nebula_3 = yes }
						20 = { create_nebula_4 = yes }
						10 = { create_rare_nebula_1 = yes }
						10 = { create_rare_nebula_2 = yes }
						4 = {
							modifier = {
								factor = 0
								has_star_flag = empire_home_system
							}
							create_turbulent_nebula_1 = yes
						}
						4 = {
							modifier = {
								factor = 0
								has_star_flag = empire_home_system
							}
							create_turbulent_nebula_2 = yes
						}
					}
				}
			}
			# Class F
			else_if = {
				limit = { is_star_class = sc_f }
				random_list = {
					20 = { create_nebula_3 = yes }
					20 = { create_nebula_4 = yes }
					10 = { create_rare_nebula_1 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_1 = yes
					}
				}
			}
			# Class G
			else_if = {
				limit = {
					OR = {
						is_star_class = sc_g
						is_star_class = sc_binary_8
						is_star_class = sc_trinary_1
					}
				}
				random_list = {
					20 = { create_nebula_1 = yes }
					10 = { create_rare_nebula_2 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_2 = yes
					}
				}
			}
			# Class K
			else_if = {
				limit = {
					OR = {
						is_star_class = sc_k
						is_star_class = sc_binary_7
						is_star_class = sc_trinary_3
					}
				}
				random_list = {
					20 = { create_nebula_1 = yes }
					20 = { create_nebula_2 = yes }
					10 = { create_rare_nebula_2 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_2 = yes
					}
				}
			}
			# Class M
			else_if = {
				limit = {
					OR = {
						is_star_class = sc_m
						is_star_class = sc_m_giant
						is_star_class = sc_binary_3
						is_star_class = sc_binary_4
						is_star_class = sc_binary_6
					}
				}
				random_list = {
					20 = { create_nebula_1 = yes }
					20 = { create_nebula_2 = yes }
					10 = { create_rare_nebula_2 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_2 = yes
					}
				}
			}
			# Class T
			else_if = {
				limit = { is_star_class = sc_t }
				random_list = {
					20 = { create_nebula_3 = yes }
					10 = { create_rare_nebula_1 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_1 = yes
					}
				}
			}
			# Black Hole
			else_if = {
				limit = { is_star_class = sc_black_hole }
				random_list = {
					20 = { create_nebula_1 = yes }
					20 = { create_nebula_2 = yes }
					20 = { create_nebula_3 = yes }
					20 = { create_nebula_4 = yes }
					10 = { create_rare_nebula_1 = yes }
					10 = { create_rare_nebula_2 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_1 = yes
					}
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_2 = yes
					}
				}
			}
			# Neutron Star
			else_if = {
				limit = { is_star_class = sc_neutron_star }
				random_list = {
					20 = { create_nebula_3 = yes }
					20 = { create_nebula_4 = yes }
					10 = { create_rare_nebula_1 = yes }
					10 = { create_rare_nebula_2 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_1 = yes
					}
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_2 = yes
					}
				}
			}
			# Pulsar
			else_if = {
				limit = { is_star_class = sc_pulsar }
				random_list = {
					20 = { create_nebula_3 = yes }
					20 = { create_nebula_4 = yes }
					10 = { create_rare_nebula_1 = yes }
					10 = { create_rare_nebula_2 = yes }
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_1 = yes
					}
					4 = {
						modifier = {
							factor = 0
							has_star_flag = empire_home_system
						}
						create_turbulent_nebula_2 = yes
					}
				}
			}
		}
	}
}