Typed owed vessels, ship lab building type, shield vessel gate

Groundwork for #5. vessels_owed carries the VESSEL TYPE rather than a
bare count, so a shield vessel finishing while the player is on a planet
comes back as a shield vessel. Fleet.add_ship takes a type, and vessels
already flying are re-statted when an upgrade is researched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-11 23:10:07 +02:00
commit 19ac758da1
9 changed files with 80 additions and 27 deletions

View file

@ -557,7 +557,7 @@ func _refresh_craft_status() -> void:
# A full fleet cannot take another vessel, so the order would be refused.
# Showing that on the button is the difference between "not available yet"
# and a button that looks live and silently does nothing when pressed.
var room: bool = fleet.ships.size() + GameState.ships_owed \
var room: bool = fleet.ships.size() + GameState.vessels_owed.size() \
+ GameState.pending_orders_of(craft_building_id, GameState.PRODUCT_SHIP) \
< GameState.max_fleet_size()
craft_interceptor_button.enabled = room
@ -568,7 +568,7 @@ func _refresh_craft_status() -> void:
craft_status.text += " Fleet %d/%d" % [fleet.ships.size(), GameState.max_fleet_size()]
else:
var queued_ships: int = GameState.pending_orders_of(craft_building_id, GameState.PRODUCT_SHIP)
var owed: int = GameState.ships_owed + queued_ships
var owed: int = GameState.vessels_owed.size() + queued_ships
var pending_note: String = "" if owed == 0 else " (%d already on order)" % owed
craft_status.text = "No room in the fleet: %d/%d%s - research capacity at the mothership\n%s" % [
fleet.ships.size(), GameState.max_fleet_size(), pending_note, craft_status.text
@ -586,8 +586,8 @@ func _on_craft_interceptor() -> void:
if craft_building_id == 0:
return
# Still refused when there is nowhere to put the vessel - queueing an
# order that can never be delivered would just bank ships_owed forever.
if fleet.ships.size() + GameState.ships_owed \
# order that can never be delivered would just bank vessels_owed forever.
if fleet.ships.size() + GameState.vessels_owed.size() \
+ GameState.pending_orders_of(craft_building_id, GameState.PRODUCT_SHIP) \
>= GameState.max_fleet_size():
_say("Fleet is full (%d slots)" % GameState.max_fleet_size())