#157 was already satisfied - second_hull is quest 7 and extractor is quest 11 - so this pins the property rather than adding a quest: nothing costing more than a single hold may be asked for before the chain has grown the fleet or taught banking. It fails if either is ever moved behind it. #158 - a building's local costs may now be paid out of the fleet's hold. #12 made production cost resources physically DELIVERED rather than money out of the bank, and that stands: the bank is still not raided here. The hold is simply the other place resources physically are, and making the player park, open the transfer menu and move cargo across by hand was ceremony rather than a decision. But only WHERE THE FLEET IS, and that qualifier is the whole design. The first draft had no range on it and test_manual_supply_route caught it immediately: a crafter three thousand units away reached into the hold and spent ore the player had just withdrawn to carry somewhere else - which is exactly the complaint that got automatic banking removed in #24, arriving from the other direction. The range is Building.interact_radius, the same distance that decides whether the transfer button appears, so the rule is not a hidden one: if you could hand the cargo over, the building can take it. #159 - the mothership floored at 1hp, so a battered one sat there reading as dead and never exploded. That exemption existed to prevent a soft-lock, and the soft-lock turns out not to exist: the bank is GameState.bank_inventory and the hangar is stored_vessels, both of which outlive any building; the mothership is the one structure research never gates; it costs exactly what a single interceptor's hold carries; and ore comes from asteroids, which do not run out. So the way back is always mine, fly, rebuild - and that is what test_building_health now asserts, in place of the exemption that used to stand in for it.
This commit is contained in:
parent
2e0c666c2b
commit
4c920f10b0
7 changed files with 397 additions and 39 deletions
|
|
@ -18,7 +18,12 @@ extends SceneTree
|
|||
# triggered on arrival (#14); #24 removed that entirely, because an
|
||||
# automatic one-way move overrides a player who has just loaded the
|
||||
# hold in order to carry ore somewhere else
|
||||
# 4. a building takes the fleet's whole hold when opened
|
||||
# 4. a building takes the fleet's whole hold when opened - and since #158
|
||||
# it does not need to be asked: a queued order at a building the fleet
|
||||
# is PARKED ON pays itself out of the hold, so the hand-off happens on
|
||||
# arrival rather than through the transfer menu. The manual move still
|
||||
# works and is still what stocks a building ahead of an order, which is
|
||||
# checked separately here
|
||||
# 5. end to end: a queued order the bank cannot reach is fulfilled using
|
||||
# only the fleet, with no Transport Hub in existence
|
||||
# 6. nothing is created or destroyed anywhere along the route
|
||||
|
|
@ -153,12 +158,31 @@ func _process(delta: float) -> bool:
|
|||
5:
|
||||
if elapsed < 0.6:
|
||||
return false
|
||||
var moved: int = game_state.transfer_to_building(crafter_id, game_state.fleet_cargo)
|
||||
if moved != GameState.SHIP_COST or game_state.fleet_cargo != 0:
|
||||
print("TEST_MANUAL_SUPPLY_ROUTE: FAIL (unloaded %d, hold left at %d)" % [moved, game_state.fleet_cargo])
|
||||
# #158: parked on the crafter with the ore aboard, the queued
|
||||
# order takes it - the flight IS the delivery now, and the hold
|
||||
# is empty because it has been spent rather than because nothing
|
||||
# happened.
|
||||
if game_state.fleet_cargo != 0:
|
||||
print("TEST_MANUAL_SUPPLY_ROUTE: FAIL (parked on the crafter with %d still in the hold)" % game_state.fleet_cargo)
|
||||
quit(1)
|
||||
return true
|
||||
print("unloaded %d into the crafter" % moved)
|
||||
# Orders run at build_time_scale 0.02 here, so by now it has not
|
||||
# only started on the hold's ore but finished.
|
||||
if game_state.pending_orders(crafter_id) != 0:
|
||||
print("TEST_MANUAL_SUPPLY_ROUTE: FAIL (the hold emptied but the order is still queued)")
|
||||
quit(1)
|
||||
return true
|
||||
print("parked on the crafter: the queued order took the hold's %d itself" % GameState.SHIP_COST)
|
||||
|
||||
# ...and the manual move still works, which is what stocks a
|
||||
# building AHEAD of an order rather than paying for one.
|
||||
game_state.collect_cargo(4)
|
||||
var moved: int = game_state.transfer_to_building(crafter_id, 4)
|
||||
if moved != 4 or game_state.fleet_cargo != 0:
|
||||
print("TEST_MANUAL_SUPPLY_ROUTE: FAIL (hand-unloaded %d of 4, hold left at %d)" % [moved, game_state.fleet_cargo])
|
||||
quit(1)
|
||||
return true
|
||||
print("and a hand transfer still moves %d into the crafter" % moved)
|
||||
elapsed = 0.0
|
||||
stage = 6
|
||||
return false
|
||||
|
|
@ -183,7 +207,9 @@ func _process(delta: float) -> bool:
|
|||
print("queued order fulfilled by hand, no transport hub: %d vessel in the hangar" % game_state.stored_vessels.size())
|
||||
|
||||
# --- 6. conservation ----------------------------------------
|
||||
var expected: int = total_before - GameState.SHIP_COST
|
||||
# The 4 mined above to exercise the hand transfer are still in
|
||||
# the crafter's stock, so they are part of the total.
|
||||
var expected: int = total_before - GameState.SHIP_COST + 4
|
||||
if _total() != expected:
|
||||
print("bank=%d hold=%d stocks total=%d, expected %d" % [
|
||||
game_state.rocks, game_state.fleet_cargo, _total(), expected
|
||||
|
|
|
|||
Loading…
Reference in a new issue