Add timed craft queue and hangar

This commit is contained in:
Loïc Wisniewski 2026-08-12 22:47:46 +02:00
commit 82552464d2
14 changed files with 660 additions and 191 deletions

View file

@ -35,7 +35,8 @@ func _initialize() -> void:
game_state.buildings.clear()
game_state.extractors.clear()
game_state.transporters.clear()
game_state.vessels_owed.clear()
game_state.stored_vessels.clear()
game_state.build_time_scale = 0.02
game_state.reset_progression()
game_state.rocks = 1200
game_state.fleet_cargo = 0
@ -154,16 +155,25 @@ func _process(delta: float) -> bool:
stage = 2
return false
2:
if elapsed < 0.6:
if elapsed < game_state.build_time(GameState.VESSEL_SHIELD) * 3.0:
return false
# Finished vessels wait at the mothership (#23); crew it here so
# the rest of the checks can look at a real ship.
if game_state.stored_vessels.size() != 1:
print("TEST_SHIP_LAB: FAIL (the shield order produced nothing: %s)" % [game_state.stored_vessels])
quit(1)
return true
if String(game_state.stored_vessels[0]) != GameState.VESSEL_SHIELD:
print("TEST_SHIP_LAB: FAIL (a shield order came back as %s)" % game_state.stored_vessels[0])
quit(1)
return true
fleet.add_ship(game_state.take_stored_vessel(0))
var shield_ship: Node = null
for ship in fleet.ships:
if is_instance_valid(ship) and ship.vessel_type == GameState.VESSEL_SHIELD:
shield_ship = ship
if shield_ship == null:
print("TEST_SHIP_LAB: FAIL (the shield order produced no shield vessel: %d ships, owed %s)" % [
fleet.ships.size(), game_state.vessels_owed
])
print("TEST_SHIP_LAB: FAIL (crewing the stored shield vessel produced none: %d ships)" % fleet.ships.size())
quit(1)
return true
if not shield_ship.has_shield():