A rare, deterministically-seeded landable body yielding a fourth resource, dark matter, obtainable only through an extractor - never a surface pickup. Reuses every existing generic system (resource/planet definitions, surface profiles, extractor/transporter pipeline) with no type-switch branching. Also fixes a latent conquest-gating gap: a surface profile with no authored PlanetSetup (like the black hole's "void") never registered capture points at all, permanently blocking extractor placement. register_capture_points() now treats zero required points as vacuously conquered, and PlanetSurfaceController registers that zero-point state explicitly when no setup exists.
22 lines
695 B
GDScript
22 lines
695 B
GDScript
class_name ResourceDefinitions
|
|
extends RefCounted
|
|
|
|
const ORE_ID: String = "ore"
|
|
const GAS_ID: String = "gas"
|
|
const ENERGY_ID: String = "energy"
|
|
const DARK_MATTER_ID: String = "dark_matter"
|
|
const ORDER: PackedStringArray = [ORE_ID, GAS_ID, ENERGY_ID, DARK_MATTER_ID]
|
|
const DEFINITIONS: Dictionary = {
|
|
ORE_ID: preload("res://OreResourceDefinition.tres"),
|
|
GAS_ID: preload("res://GasResourceDefinition.tres"),
|
|
ENERGY_ID: preload("res://EnergyResourceDefinition.tres"),
|
|
DARK_MATTER_ID: preload("res://DarkMatterResourceDefinition.tres"),
|
|
}
|
|
|
|
|
|
static func get_definition(resource_id: String) -> Resource:
|
|
return DEFINITIONS.get(resource_id)
|
|
|
|
|
|
static func ids() -> PackedStringArray:
|
|
return ORDER
|