#216: transport hubs and spacial workshops no longer conjure their crews. Transporters and repair drones are ordered at a ship crafter, assigned per building through a new Station menu, flown out from the mothership hangar, and spent by the work they do - 20 runs, 12 repairs, counted where the run ENDS so nothing retires with cargo in the air or a building half repaired. A spent vessel is gone, so the structure is short again and the player has to build another. The menu shows what each one has left, worst first. Craftability needed its own flag: "the crafter can make it" and "it can take a berth in the fleet" stopped being the same question. #217: transporters crawl at 120 rather than 150, and a Burn Drive lets them carry energy and spend it to travel far faster. Fetching it is a leg of its own, to the nearest store that has any - so a refuelling transporter cannot be dispatched mid-errand - and the leg flown to COLLECT fuel is not charged for it. Unresearched, nothing detours and nothing changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
47 lines
1.7 KiB
GDScript
47 lines
1.7 KiB
GDScript
class_name VesselDefinitions
|
|
extends RefCounted
|
|
|
|
const ORDER: PackedStringArray = ["interceptor", "shield", "gas_bomber", "transporter", "carrier", "laser", "distorder", "repair_drone"]
|
|
const DEFINITIONS: Dictionary = {
|
|
"interceptor": preload("res://vessels/InterceptorVesselDefinition.tres"),
|
|
"shield": preload("res://vessels/ShieldVesselDefinition.tres"),
|
|
"gas_bomber": preload("res://vessels/GasBomberVesselDefinition.tres"),
|
|
"transporter": preload("res://vessels/TransporterVesselDefinition.tres"),
|
|
"carrier": preload("res://vessels/CarrierVesselDefinition.tres"),
|
|
"laser": preload("res://vessels/LaserVesselDefinition.tres"),
|
|
"distorder": preload("res://vessels/DistorderVesselDefinition.tres"),
|
|
"repair_drone": preload("res://vessels/RepairDroneVesselDefinition.tres"),
|
|
}
|
|
|
|
static func get_definition(definition_id: String) -> Resource:
|
|
return DEFINITIONS.get(definition_id)
|
|
|
|
static func all() -> Array:
|
|
var result: Array = []
|
|
for definition_id in ORDER:
|
|
result.append(DEFINITIONS[definition_id])
|
|
return result
|
|
|
|
|
|
static func fleet() -> Array:
|
|
var result: Array = []
|
|
for definition in all():
|
|
if definition.fleet_eligible:
|
|
result.append(definition)
|
|
return result
|
|
|
|
# Everything a ship crafter can be asked for: the fleet hulls, plus #216's
|
|
# support craft. Ordered fleet-first so the craft menu's own rows do not move
|
|
# when a support vessel is added.
|
|
static func craftable() -> Array:
|
|
var result: Array = fleet()
|
|
for definition in all():
|
|
if definition.support_craftable and not definition.fleet_eligible:
|
|
result.append(definition)
|
|
return result
|
|
|
|
static func with_capability(capability: String) -> Resource:
|
|
for definition in all():
|
|
if definition.has_capability(capability):
|
|
return definition
|
|
return null
|