Add transfer amounts and active gas vents

This commit is contained in:
Loïc Wisniewski 2026-08-14 13:44:10 +02:00
commit e4df9bc41a
8 changed files with 147 additions and 12 deletions

View file

@ -27,4 +27,5 @@ func _ready() -> void:
bc.transfer_building_id = crafter_id
main.get_node("UI/TransferMenu").visible = true
bc._refresh_transfer()
bc.transfer_list._change_amount(GameState.RESOURCE_ORE, -1)
bc.transfer_status.text = "Moved 25 ore into this building"

View file

@ -33,6 +33,23 @@ func _process(delta: float) -> bool:
if nearby_position.length() > WorldGen.CHUNK_SIZE * 2.0:
return _fail("nearby gas giant spawned too far away: %s" % nearby_position)
# Gas surfaces have vents only: no deferred ore pickups, and the vent
# emission advances continuously so the source visibly looks active.
game_state.planet_name = "Gas Test"
game_state.planet_type = "gas_giant"
var surface: Node = load("res://PlanetSurface.tscn").instantiate()
root.add_child(surface)
var rock_field: Node = surface.get_node("RockField")
var gas_field: Node = surface.get_node("GasVentField")
if not rock_field.rocks.is_empty() or rock_field.is_processing():
surface.free()
return _fail("gas surface spawned or continued processing ore rocks")
gas_field._process(0.5)
if gas_field.emission_phase <= 0.0:
surface.free()
return _fail("gas-source emission animation did not advance")
surface.free()
var found_giant: bool = false
for x in range(-12, 13):
for y in range(-12, 13):

View file

@ -180,11 +180,22 @@ func _process(delta: float) -> bool:
# The handler working while the BUTTON is inert is the exact bug
# class this project keeps hitting, so one press goes the long way.
var bank_at_tap: int = game_state.rocks
_tap(scene.get_node("UI/TransferMenu/ResourceList/OreToFleetButton"))
var resource_list: Node = scene.get_node("UI/TransferMenu/ResourceList")
# Default is ALL. One minus selects 25, proving the amount control
# affects a real transfer rather than only changing its caption.
_tap(resource_list.get_node("OreDecreaseButton"))
_tap(resource_list.get_node("OreToFleetButton"))
_expect(game_state.fleet_cargo == mini(GameState.CARGO_LOAD_BATCH, bank_at_tap),
"selected 25 but the real tap loaded %d" % game_state.fleet_cargo)
_expect(game_state.rocks == bank_at_tap - game_state.fleet_cargo,
"the bank did not pay the selected transfer amount")
# Back to ALL and move the remainder, preserving the original
# end-to-end all-transfer coverage as well.
_tap(resource_list.get_node("OreIncreaseButton"))
_tap(resource_list.get_node("OreToFleetButton"))
_expect(game_state.fleet_cargo == bank_at_tap,
"a real tap did not load all banked ore")
_expect(game_state.rocks == 0,
"the bank did not pay for the tapped withdrawal")
"switching back to ALL did not load the remainder")
_expect(game_state.rocks == 0, "ALL left ore in the bank")
# --- 7. conservation ----------------------------------------
_expect(_total() == total_before,