# Check if a planet can be targetd by a planet killer weapon
# Scope:
#	this = planet being targeted
#	from = fleet
#can_destroy_planet_with_PLANET_DESTRUCTION_COMPONENT = {
#	...
#}
dwe_is_special_planet = {
	OR = {
		# Hyperconstructs Types
		is_planet_class = pc_ascension_portal
		# Gigastructures Types
		is_planet_class = pc_core_black_hole
		is_planet_class = pc_core_quasar
		is_planet_class = pc_birch
		is_planet_class = pc_origin_birch
		is_planet_class = pc_origin_dummy_birch
		is_planet_class = pc_giga_edge_of_eternity
		is_planet_class = pc_giga_frameworld
		is_planet_class = pc_giga_empty_space_asteroid
		is_planet_class = pc_void_birch
		# PD Types
		is_planet_class = pc_pd_orange_warform
		is_planet_class = pc_pd_zro
		is_planet_class = pc_pd_red_warform
		is_planet_class = pc_pd_blue_warform
		is_planet_class = pc_pd_scrapyard
		is_planet_class = pc_crystal
		is_planet_class = pc_floating
		is_planet_class = pc_graveyard 
		is_planet_class = pc_technoorganic
		is_planet_class = pc_archive
		is_planet_class = pc_crucible
		is_planet_class = pc_shroud_crucible
		is_planet_class = pc_clean_crucible
	}
}

can_destroy_planet_with_PLANET_KILLER_NULLVOID = {
	custom_tooltip = {
		fail_text = is_not_a_standard_planet_or_megastructure
		is_a_planet_megastructure = yes
	}
	custom_tooltip = {
		fail_text = is_shielded
		NOR = {
			is_planet_class = pc_shielded
			is_planet_class = pc_ringworld_shielded
			is_planet_class = pc_habitat_shielded
		}
	}
	custom_tooltip = {
		fail_text = fotd_cant_collossus
		NOT = { has_planet_flag = fotd_seperatist_planet@from.owner }
		exists = from.owner
		from.owner = { 
			NOT = { has_country_flag = fotd_seperatist_country@from.owner }
		}
	}
	OR = {
		custom_tooltip = {
			text = is_not_hostile_cracker
			OR = {
				AND = {
					exists = space_owner
					space_owner = {
						OR = {
							is_at_war_with = from.owner
							is_country_type = swarm
							is_country_type = extradimensional
							is_country_type = extradimensional_2
							is_country_type = extradimensional_3
							is_country_type = ai_empire
						}
					}
				}
				AND = { # colony
					exists = owner
					owner = {
						OR = {
							is_at_war_with = from.owner
							is_country_type = swarm
							is_country_type = extradimensional
							is_country_type = extradimensional_2
							is_country_type = extradimensional_3
							is_country_type = ai_empire
						}
					}
				}
			}
		}
		AND = {
			# primitive target
			custom_tooltip = {
				text = cannot_crack_pre_ftl_planet_ownership
				exists = space_owner
				exists = owner
				owner = {
					is_primitive = yes
				}
				space_owner = {
					OR = {
						#is_same_value = from.owner
						is_at_war_with = from.owner
						is_country_type = swarm
						is_country_type = extradimensional
						is_country_type = extradimensional_2
						is_country_type = extradimensional_3
						is_country_type = ai_empire
					}
				}
			}
			custom_tooltip = {
				text = cannot_crack_pre_ftl_planet_interference
				# primitive
				exists = owner
				owner = {
					is_primitive = yes
				}
				from.owner = {
					has_policy_flag = interference_aggressive
				}
			}
		}
		custom_tooltip = {
			text = not_barren_molten_frozen_toxic_test_fire
			NOT = { exists = owner }
			OR = {
				NOT = { exists = space_owner }
				AND = {
					exists = space_owner
					space_owner = { is_same_value = from.owner }
				}
			}
			OR = {
				habitable_planet = yes
				uninhabitable_regular_planet = yes
				is_artificial = yes
			}
			NOT = {
				dwe_is_special_planet = yes
			}
		}
	}
}