Buy fleet berths with Fleet Offices

#219: fleet capacity is a built, supplied thing rather than a researched
one. The eight fleet-size doctrines are gone; capacity is one berth free
plus one per Fleet Office standing. An office charges every 25s for the
vessel in its berth, priced off that vessel's own build cost so an expensive
hull is expensive to keep, and drawn from its own store the way a gas burner
draws gas. An office that cannot pay goes dark, its vessel is scuttled, and
the player is told through the same queue quest lines use - which reaches
them on a planet surface too.

An empty berth is idle rather than starved: an office is only failing while
there is something in it to fail, and holding it disabled would leave a
berth that could never be crewed and so could never be paid for again.

Ships have no hit points and a shield absorbs a hit wholesale, so the lost
vessel is scuttled rather than damaged - otherwise a shielded hull would
survive its own eviction.

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 17:09:27 +02:00
commit 1f5fecd371
60 changed files with 695 additions and 243 deletions

View file

@ -51,6 +51,23 @@ func _ready() -> void:
# Researching a vessel upgrade improves the ships already flying, not
# just the next one built (#5).
GameState.vessel_upgraded.connect(_on_vessel_upgraded)
# #219: a Fleet Office that runs dry loses the vessel it was keeping.
# GameState decides THAT it happens - it owns the supply - and the fleet
# owns the hulls, so it is the one that gives this one up.
GameState.fleet_upkeep_failed.connect(_on_fleet_upkeep_failed)
# Destroyed rather than stored: the vessel is not being put away, it is being
# lost, and taking it out through the ordinary death path means it explodes,
# is heard, and leaves the formation exactly as a vessel shot down does.
func _on_fleet_upkeep_failed(slot_index: int, _vessel_type: String) -> void:
if slot_index < 0 or slot_index >= ships.size():
return
var lost: Node = ships[slot_index]
if is_instance_valid(lost) and not lost.is_queued_for_deletion():
# scuttle(), not take_damage(): a shield charge would ABSORB a hit,
# and there is no hit here - the berth simply stopped being paid for.
lost.scuttle()
func _on_vessel_upgraded(_id: String) -> void:

View file

@ -171,6 +171,15 @@ func take_damage(_amount: int) -> bool:
for child in get_children():
if child.has_method("absorb_hit") and child.absorb_hit():
return true
scuttle()
return false
# Lost for a reason no shield can answer - #219's Fleet Office running dry,
# rather than something hitting it. Same ending as a lethal hit, deliberately:
# what the player sees is a vessel they had and no longer have, and giving
# that its own quieter exit would read as the ship simply vanishing.
func scuttle() -> void:
# #130: the hull comes off the formation and explodes further out, rather
# than going up on the spot. The wreck is its own node - this one is
# still freed on this frame, so nothing about who is in the fleet, who
@ -182,7 +191,6 @@ func take_damage(_amount: int) -> bool:
Sfx.play(get_tree(), Sfx.SHIP_DEATH)
destroyed.emit()
queue_free()
return false
# Which way is "out of the fleet". Away from the formation's own centre, so a