Research the Fleet Office, and give it one hull

Fleet Offices sit behind a new Berth Authority doctrine. It costs ore and no
research points, deliberately: points come only from conquering a planet,
conquering needs a fleet, and the fleet caps at its opening hull until an
office exists - so pricing the fleet's own gate in them would lock a player
behind a fight that one vessel has to win first. The research unlocks the
STRUCTURE; capacity is still the built, supplied thing #219 made it.

The tree gains a sixth lane for it, so the branch that fleet size vacated is
occupied again rather than reading as a hole.

Also fixes a shape #216 exposed: a stationed transporter drew a hull written
into its own script while a delivered one drew the definition's, and the
transporter's definition declared none at all - so one in flight was an
empty polygon. Both vessels now draw the definition, and a test pins that
the two paths agree. The repair drone had the same fault, off by two units.

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 21:57:53 +02:00
commit cc71811d89
8 changed files with 161 additions and 64 deletions

View file

@ -9,8 +9,7 @@ extends SceneTree
# holes where they used to be - it is repacked from whatever is researched.
#
# Verifies:
# 1. with nothing researched only the mothership and the Fleet Office are
# offered (the mothership is
# 1. with nothing researched only the mothership is offered (it is
# deliberately never gated - it is where research happens)
# 2. researching a structure adds it, and it is placed, not left at
# whatever offsets it happened to have in the scene file
@ -80,36 +79,23 @@ func _process(delta: float) -> bool:
# --- 1. nothing researched ----------------------------------
controller._refresh_build_status()
# #219 put the Fleet Office beside the mothership at the opening:
# it is the only way the fleet grows now, so gating it behind
# research would gate fleet size behind research again - which is
# the thing that ticket removed.
var opening: Array = [GameState.BUILDING_MOTHERSHIP,
GameState.BUILDING_FLEET_OFFICE]
# The Fleet Office sits behind Berth Authority, so the opening is
# the mothership alone again - the fallback that is always there.
var shown: Array = _shown()
var shown_ids: Array = []
for e in shown:
shown_ids.append(e[0])
shown_ids.sort()
opening.sort()
if shown_ids != opening:
print("TEST_BUILD_MENU_HIDES_LOCKED: FAIL (opening offer was %s, expected %s)" \
% [shown_ids, opening])
if shown.size() != 1 or shown[0][0] != GameState.BUILDING_MOTHERSHIP:
var names: Array = []
for e in shown:
names.append(e[0])
print("TEST_BUILD_MENU_HIDES_LOCKED: FAIL (unresearched structures on offer: %s)" % [names])
quit(1)
return true
# --- 4. and the row is centred as a whole -------------------
# Two entries now, so "centred" is the pair straddling the middle
# rather than one sitting on it. The rule being checked is the
# same one: a short row is not left hanging off to one side.
var slots: Array = _slots()
var spread: float = 0.0
for slot in slots:
spread += float(slot[1])
if absf(spread) > 0.01:
print("TEST_BUILD_MENU_HIDES_LOCKED: FAIL (the opening row is off-centre by %.1f)" % spread)
# --- 4. and it is centred, being alone on its row -----------
var only: Array = _slots()[0]
if absf(only[1]) > 0.01:
print("TEST_BUILD_MENU_HIDES_LOCKED: FAIL (the only entry sits at x=%.1f instead of centred)" % only[1])
quit(1)
return true
print("nothing researched -> the mothership and a Fleet Office, centred")
print("nothing researched -> only the mothership, centred")
# --- 2. research three more ---------------------------------
game_state.unlocked = ["shipyards", "logistics", "coordination"]
@ -117,11 +103,9 @@ func _process(delta: float) -> bool:
stage = 1
return false
1:
# Three doctrines add three structures to the two the opening
# already offers (#219's Fleet Office is one of those two).
var shown2: Array = _shown()
if shown2.size() != 5:
print("TEST_BUILD_MENU_HIDES_LOCKED: FAIL (researched 3, expected 5 entries, got %d)" % shown2.size())
if shown2.size() != 4:
print("TEST_BUILD_MENU_HIDES_LOCKED: FAIL (researched 3, expected 4 entries, got %d)" % shown2.size())
quit(1)
return true
for e in shown2: