Refactor recent gameplay systems after code review

This commit is contained in:
Loïc Wisniewski 2026-08-16 21:38:07 +02:00
commit d68f4d4f88
57 changed files with 530 additions and 572 deletions

View file

@ -738,7 +738,7 @@ func _refresh_skill_menu(id: String = "") -> void:
var node: Dictionary = GameState.skill_node(id)
if node.is_empty():
return
var points_needed: int = int(node.get("research_points", 0))
var points_needed: int = GameState.skill_research_point_cost(id)
skill_detail.text = "%s\n%s" % [node.name, node.desc]
if points_needed > 0:
skill_detail.text += "\nResearch points: %d/%d" % [GameState.research_points, points_needed]
@ -1043,7 +1043,7 @@ func _transfer_place_name() -> String:
var b: Dictionary = GameState.find_building(transfer_building_id)
if b.is_empty():
return "this building"
if b.type == GameState.BUILDING_MOTHERSHIP:
if GameState.building_has_capability(b, "bank"):
# Worth naming as the bank rather than as a structure: this is the
# one building where unloading makes the ore spendable everywhere.
return "the bank"
@ -1056,7 +1056,7 @@ func _refresh_transfer() -> void:
return
var building: Dictionary = GameState.find_building(transfer_building_id)
var heading: String = "This building"
if not building.is_empty() and building.type == GameState.BUILDING_MOTHERSHIP:
if GameState.building_has_capability(building, "bank"):
heading = "Mothership bank"
transfer_list.set_destination(transfer_building_id, heading)