2026-08-14 22:46:25 +02:00
|
|
|
extends SceneTree
|
|
|
|
|
|
|
|
|
|
var state: Node
|
|
|
|
|
var lab_id: int
|
|
|
|
|
var elapsed: float = 0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _initialize() -> void:
|
|
|
|
|
state = root.get_node("GameState")
|
|
|
|
|
state.buildings.clear()
|
|
|
|
|
state.extractors.clear()
|
|
|
|
|
state.transporters.clear()
|
|
|
|
|
state.reset_progression()
|
|
|
|
|
state.rocks = 100
|
2026-08-16 20:14:29 +02:00
|
|
|
state.research_points = 1
|
2026-08-14 22:46:25 +02:00
|
|
|
state.build_time_scale = 0.02
|
|
|
|
|
state.add_building(state.BUILDING_MOTHERSHIP, Vector2.ZERO)
|
2026-08-15 00:09:10 +02:00
|
|
|
state.add_building(state.BUILDING_TRANSPORT_HUB, Vector2(50, 0))
|
Build the logistics crews, and let them burn energy
#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
2026-09-05 19:09:35 +02:00
|
|
|
# #216: a hub arrives empty now - its transporters are built and
|
|
|
|
|
# flown in. This test is about the ROUTE, so the crew is put
|
|
|
|
|
# straight at its post; test_transporter_supply.gd owns the journey.
|
|
|
|
|
load("res://tests/_staff.gd").staff_all(state)
|
2026-08-14 22:46:25 +02:00
|
|
|
lab_id = state.add_building(state.BUILDING_SHIP_LAB, Vector2(100, 0))
|
|
|
|
|
if not state.queue_lab_research(lab_id, "int_damage"):
|
|
|
|
|
return _fail("could not queue lab research")
|
|
|
|
|
if state.outstanding_cost(lab_id) != state.upgrade_cost("int_damage"):
|
|
|
|
|
return _fail("queued research did not expose its ore demand")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _process(delta: float) -> bool:
|
|
|
|
|
elapsed += delta
|
|
|
|
|
if state.upgrade_level("int_damage") == 1:
|
|
|
|
|
if state.lab_research_order(lab_id).is_empty():
|
|
|
|
|
print("transporter supplied queued lab research end to end")
|
|
|
|
|
print("TEST_LAB_TRANSPORTER_DELIVERY: PASS")
|
|
|
|
|
quit(0)
|
|
|
|
|
return true
|
|
|
|
|
if elapsed > 5.0:
|
|
|
|
|
return _fail("lab still waiting: demand=%d transporter=%s stock=%d" % [
|
|
|
|
|
state.outstanding_cost(lab_id), state.transporters[0].state,
|
|
|
|
|
state.building_stock(lab_id)])
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _fail(message: String) -> bool:
|
|
|
|
|
print("TEST_LAB_TRANSPORTER_DELIVERY: FAIL (%s)" % message)
|
|
|
|
|
quit(1)
|
|
|
|
|
return true
|