Supply a building by hand: withdraw at the mothership, unload on arrival
Forgejo #17, part 4 of #12. #16 lets an order queue waiting for ore, so something has to be able to fulfil one. Until transporters exist (#19) this is the only route, which is why it lands before them rather than after: otherwise a player with a queued order and no Transport Hub is stuck forever. A "Load ore" button at the mothership moves a batch from the bank into the fleet's hold, and opening a building hands it whatever the fleet is carrying. Delivery at the mothership is now EDGE triggered on arrival rather than running every frame the fleet is parked there. Continuous delivery made withdrawing impossible - ore loaded into the hold was banked again on the very next frame, so the button would have looked broken. A batch rather than the whole bank, because the hold is the part that can be lost and emptying the bank in one tap would also strand research, which still spends from it. Both new logistics tests now clear existing asteroids: disabling AsteroidField only stops new chunks spawning, and a drifting rock destroying a parked ship changed the fleet size the tests assert on. That was a real intermittent failure, seen once in a full run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
3573ccf44f
commit
ff162faef5
6 changed files with 296 additions and 3 deletions
|
|
@ -39,6 +39,8 @@ extends Node2D
|
|||
@onready var craft_interceptor_button: IconButton = get_node("../UI/CraftMenu/InterceptorButton")
|
||||
@onready var craft_close_button: IconButton = get_node("../UI/CraftMenu/CloseButton")
|
||||
@onready var craft_status: Label = get_node("../UI/CraftMenu/StatusLabel")
|
||||
@onready var load_ore_button: IconButton = get_node("../UI/SkillMenu/LoadOreButton")
|
||||
@onready var load_ore_label: Label = get_node("../UI/SkillMenu/LoadOreLabel")
|
||||
|
||||
@onready var skill_menu: Control = get_node("../UI/SkillMenu")
|
||||
@onready var skill_tree: Control = get_node("../UI/SkillMenu/Tree")
|
||||
|
|
@ -104,6 +106,7 @@ func _ready() -> void:
|
|||
action_button.pressed.connect(_on_action_pressed)
|
||||
|
||||
craft_interceptor_button.pressed.connect(_on_craft_interceptor)
|
||||
load_ore_button.pressed.connect(_on_load_ore)
|
||||
craft_close_button.pressed.connect(func(): craft_menu.visible = false)
|
||||
|
||||
formation_close_button.pressed.connect(func(): formation_menu.visible = false)
|
||||
|
|
@ -211,6 +214,7 @@ func _on_action_pressed() -> void:
|
|||
return
|
||||
if current_building.building_type == GameState.BUILDING_MOTHERSHIP:
|
||||
skill_menu.visible = true
|
||||
_refresh_load_ore()
|
||||
_refresh_skill_menu()
|
||||
elif current_building.building_type == GameState.BUILDING_SHIP_CRAFTER:
|
||||
craft_menu.visible = true
|
||||
|
|
@ -454,6 +458,17 @@ func _on_craft_interceptor() -> void:
|
|||
_refresh_craft_status()
|
||||
|
||||
|
||||
func _refresh_load_ore() -> void:
|
||||
load_ore_label.text = "Load ore\nBank %d Hold %d" % [GameState.rocks, GameState.fleet_cargo]
|
||||
load_ore_button.enabled = GameState.rocks > 0
|
||||
load_ore_button.queue_redraw()
|
||||
|
||||
|
||||
func _on_load_ore() -> void:
|
||||
GameState.withdraw_to_fleet()
|
||||
_refresh_load_ore()
|
||||
|
||||
|
||||
func _on_formation_changed() -> void:
|
||||
fleet.apply_formation()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue