Plan every craftable vessel, and stop restating the point cost
#221: the planning centre listed only fleet-eligible hulls, so the two vessels that most need replacing were the two it could not plan - #216 made transporters and repair drones wear out, which is what a standing order is for. It offers everything a crafter can build now. That needed the census to see them: it counted the fleet, the hangar, garrisons and transit, but not vessels standing at a hub or a workshop. An order for a transporter would never have seen the ones already built, and the crafters would have gone on making more forever. #222: the ship lab's detail block restated the selected upgrade's research point cost, which its own card shows a few pixels higher. Removed, with the parameter and the call-site lookup that fed it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
This commit is contained in:
parent
2bb46cba94
commit
f77596395b
4 changed files with 45 additions and 8 deletions
|
|
@ -69,6 +69,25 @@ func _state_cases() -> bool:
|
|||
# --- A. one vessel, one count, wherever it is ------------------------
|
||||
if game_state.vessel_census(interceptor) != 0:
|
||||
return _fail("an empty game counts %d vessels" % game_state.vessel_census(interceptor))
|
||||
|
||||
# --- #221: support craft are plannable too --------------------------
|
||||
# #216 made transporters and repair drones ordinary craft that wear out
|
||||
# and need replacing, which is exactly what a standing order is for -
|
||||
# and they were the one thing the planning centre could not plan.
|
||||
var plannable: PackedStringArray = game_state.planned_vessel_types()
|
||||
for support in [GameState.VESSEL_TRANSPORTER, GameState.REPAIR_DRONE]:
|
||||
if not plannable.has(support):
|
||||
return _fail("'%s' cannot be planned, so a standing order cannot replace one" % support)
|
||||
# And the census has to SEE them where they live, or an order for one
|
||||
# could never be satisfied and the crafters would build forever.
|
||||
var hub_id: int = game_state.add_building(GameState.BUILDING_TRANSPORT_HUB,
|
||||
Vector2(1200.0, 0.0))
|
||||
load("res://tests/_staff.gd").staff(game_state, hub_id, 1)
|
||||
if game_state.vessel_census(GameState.VESSEL_TRANSPORTER) != 1:
|
||||
return _fail("a transporter standing at a hub is counted %d times, expected once" \
|
||||
% game_state.vessel_census(GameState.VESSEL_TRANSPORTER))
|
||||
game_state.remove_buildings_of_type(GameState.BUILDING_TRANSPORT_HUB)
|
||||
print("support craft are plannable, and counted where they stand")
|
||||
game_state.fleet_vessel_types = PackedStringArray([interceptor, interceptor])
|
||||
game_state.stored_vessels.append(interceptor)
|
||||
game_state.set_garrison_desired(outpost_id, interceptor, 1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue