From 127eb90018e45f3e64cca9a6bd9b1df0db8348fa Mon Sep 17 00:00:00 2001 From: Tomasz Boruc Date: Thu, 20 Nov 2025 21:03:03 +0100 Subject: [PATCH] =?UTF-8?q?Limit=20budynk=C3=B3w=20na=20planecie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/planet.gd | 3 ++- scripts/planet_panel.gd | 17 +++++++++++++++++ scripts/technologies.gd | 6 +++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/planet.gd b/scripts/planet.gd index cc5d922..d91bb91 100644 --- a/scripts/planet.gd +++ b/scripts/planet.gd @@ -26,7 +26,8 @@ var resources := {} var buildings := [] var bonuses = { "total_pop_bonus": 0, # w % - "biosfere": 0.0, # mnożnik bazowy + "biosfere": 0.0, + "water_bonus": 0.0, # mnożnik bazowy } # słownik z ID -> stan budynku diff --git a/scripts/planet_panel.gd b/scripts/planet_panel.gd index daaa665..0b2fa0d 100644 --- a/scripts/planet_panel.gd +++ b/scripts/planet_panel.gd @@ -100,6 +100,18 @@ func _create_building_buttons(): btn.texture_normal = load(b_data.texture) btn.connect("pressed", Callable(self, "_on_building_pressed").bind(b_id)) + + var cost_text = "" + for cost_name in b_data.cost.keys(): + cost_text += "%s: %d " % [tr(cost_name), b_data.cost[cost_name]] + + btn.tooltip_text = "%s\n%s\n%s %s" % [ + tr(b_data.name), + tr(b_data.description), + tr("Koszt:"), + cost_text.strip_edges() + ] + buildings_container.add_child(btn) @@ -110,6 +122,11 @@ func _on_building_pressed(b_id): var b_data = BuildingsList.BUILDINGS[b_id] + if planet.buildings.size() >= planet.size*2: + print("Planeta osiągnęła maksymalną liczbę budynków!") + return + + # Sprawdź czy planeta ma wymagany surowiec if b_data.has("resource") and b_data["resource"] != null: var required_resource = b_data["resource"] diff --git a/scripts/technologies.gd b/scripts/technologies.gd index 87dc014..9c920bd 100644 --- a/scripts/technologies.gd +++ b/scripts/technologies.gd @@ -18,14 +18,14 @@ const TECHNOLOGIES = { }, "hydro_engineering": { "name": "Inżynieria Hydrotermalna", - "description": "Zwiększa wydobycie wody o 15%.", + "description": "Zwiększa wydobycie wody o 50%.", "time": 10, "cost": { "science": 1 }, "texture": "res://assets/tech/hydro_engineering.png", "unlock_effects": { - "water_efficiency": 1.15 + }, "requires": ["advanced_mining"] }, @@ -40,7 +40,7 @@ const TECHNOLOGIES = { }, "texture": "res://assets/tech/terraforming.png", "unlock_effects": { - "water_efficiency": 1.15 + }, "requires": ["hydro_engineering"] }