Compose buildings from definitions and capabilities

This commit is contained in:
Loïc Wisniewski 2026-08-14 21:44:28 +02:00
commit 0504b24d8d
46 changed files with 1091 additions and 878 deletions

View file

@ -69,7 +69,7 @@ func _process(delta: float) -> bool:
print("TEST_EXTRACTOR_BUILDING: FAIL (enabled with no planet in reach)")
quit(1)
return true
controller._on_place_extractor()
controller._show_building_info(GameState.BUILDING_EXTRACTOR)
var explained: bool = popup.visible and "planet" in popup.get_node("Panel/MessageLabel").text.to_lower()
var offered: bool = popup.get_node("Panel/BuildButton").visible
print("no planet: greyed=%s popup_shown=%s confirm_offered=%s" % [
@ -118,7 +118,7 @@ func _process(delta: float) -> bool:
return true
var rocks_before: int = game_state.rocks
controller._on_place_extractor()
controller._show_building_info(GameState.BUILDING_EXTRACTOR)
var planet_field2: Node = main_scene.get_node("PlanetField")
var planet2: Node2D = planet_field2.populated_chunks[target_chunk][0]
@ -148,7 +148,7 @@ func _process(delta: float) -> bool:
# A second one on the same planet must be refused, not charged.
var rocks_now: int = game_state.rocks
controller._on_build_pressed()
controller._on_place_extractor()
controller._show_building_info(GameState.BUILDING_EXTRACTOR)
var re_offered: bool = popup.get_node("Panel/BuildButton").visible
controller._confirm_build() # must do nothing even if pressed
var still_one: bool = game_state.extractors.size() == 1 and not re_offered