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

@ -46,6 +46,14 @@ func _total() -> int:
sum += int(b.get("stock", 0))
for t in game_state.transporters:
sum += int(t.get("carrying", 0))
# Ore inside a build that has STARTED but not finished (#23). It has left
# the building's stock and has not yet been consumed by a completed
# vessel, so without counting it the total dips for the length of every
# build - which is a gap in this sum, not a leak in the game.
for b in game_state.buildings:
for o in b.get("orders", []):
if bool(o.started):
sum += game_state.product_cost(String(o.product))
return sum
@ -56,7 +64,8 @@ func _initialize() -> void:
game_state.transporters.clear()
game_state.rocks = 200
game_state.fleet_cargo = 0
game_state.vessels_owed.clear()
game_state.stored_vessels.clear()
game_state.build_time_scale = 0.02
game_state.unlocked = ["shipyards", "logistics", "freight", "coordination", "wing", "squadron", "armada"]
scene = load("res://Main.tscn").instantiate()
root.add_child(scene)
@ -118,7 +127,7 @@ func _process(delta: float) -> bool:
total_at_start = _total()
return false
2:
if elapsed < 0.3:
if elapsed < game_state.build_time(GameState.PRODUCT_TRANSPORTER) * 3.0:
return false
if game_state.transporters.size() != 1:
print("TEST_TRANSPORTER_SUPPLY: FAIL (built %d transporters from one order)" % game_state.transporters.size())