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
This commit is contained in:
Loïc Wisniewski 2026-09-05 19:09:35 +02:00
commit 265e121cb0
31 changed files with 1180 additions and 141 deletions

View file

@ -89,6 +89,10 @@ func _process(_delta: float) -> bool:
game_state.add_building(GameState.BUILDING_MOTHERSHIP, Vector2.ZERO)
workshop_id = game_state.add_building(GameState.BUILDING_WORKSHOP, Vector2(600.0, 0.0))
# #216: crews are built and flown in now, not provisioned with the
# structure. This test is about what a crew DOES, so it is put
# straight at its post - test_transporter_supply.gd owns the journey.
load("res://tests/_staff.gd").staff(game_state, workshop_id, game_state.workshop_drone_capacity())
if _drones_of(workshop_id).size() != GameState.BASE_WORKSHOP_DRONES:
return _fail("a new workshop stationed %d drones, expected %d" \
% [_drones_of(workshop_id).size(), GameState.BASE_WORKSHOP_DRONES])
@ -187,6 +191,7 @@ func _process(_delta: float) -> bool:
if bonus_id == "":
return _fail("no skill node raises the drone count")
var before_count: int = _drones_of(workshop_id).size()
var before_room: int = game_state.station_capacity(game_state.find_building(workshop_id))
game_state.rocks = 5000
# #138: the deep doctrines want gas and energy too.
game_state.bank_inventory.set_amount(GameState.RESOURCE_GAS, 5000)
@ -194,10 +199,21 @@ func _process(_delta: float) -> bool:
game_state.research_points = 20
if not game_state.unlock(bonus_id):
return _fail("could not research \"%s\"" % bonus_id)
# #216: the doctrine buys ROOM, not drones. It used to provision one into
# every standing workshop for nothing; the extra berth is now something
# the player fills with a drone they have built.
if _drones_of(workshop_id).size() != before_count:
return _fail("researching \"%s\" conjured %d drones" \
% [bonus_id, _drones_of(workshop_id).size() - before_count])
var room: int = game_state.station_capacity(game_state.find_building(workshop_id))
if room != before_room + 1:
return _fail("the doctrine moved the workshop's room from %d to %d, expected %d" \
% [before_room, room, before_room + 1])
load("res://tests/_staff.gd").staff(game_state, workshop_id, room)
if _drones_of(workshop_id).size() != before_count + 1:
return _fail("a workshop built before the upgrade still has %d drones" \
return _fail("the berth the doctrine bought could not be crewed (%d drones)" \
% _drones_of(workshop_id).size())
print("\"%s\" raises an already-standing workshop from %d to %d drones" \
print("\"%s\" widens a standing workshop from %d to %d berths, crewed by hand" \
% [bonus_id, before_count, _drones_of(workshop_id).size()])
print("TEST_SPACIAL_WORKSHOP: PASS")