diff --git a/export_presets.cfg b/export_presets.cfg index 2c98e39..7e81959 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -65,3 +65,71 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue Remove-Item -Recurse -Force '{temp_dir}'" + +[preset.1] + +name="Arksol" +platform="Windows Desktop" +runnable=false +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../../GodotExe/ArkSol.exe" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=2 +binary_format/embed_pck=true +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +shader_baker/enabled=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" diff --git a/localization/translation.csv b/localization/translation.csv index b7ebc3c..085e848 100644 --- a/localization/translation.csv +++ b/localization/translation.csv @@ -8,8 +8,19 @@ menu_save,Zapisz,Save,Speichern,Guardar,Uložit language,Język,Language,Sprache,Idioma,Jazyk time_display,Data,Date,Datum,Fecha,Datum iron,Żelazo,Iron,Eisen,Hierro,Železo -alu,Aluminium,Aluminum,Aluminium,Aluminio,Hliník -titan,Tytan,Titan,Titan,Titan,Titan -uran,Uran,Uran,Uran,Uran,Uran -anti,Antymateria,Antimatter,Antimaterie,Antimateria,Antimaterie -water,Woda,Water,Water,Water,Water +copper,Miedź,Copper,Kupfer,Cobre,Měď +water,Woda,Water,Wasser,Agua,Voda +carbon,Węgiel,Carbon,Kohlenstoff,Carbon,Uhlík +aluminium,Aluminium,Aluminium,Aluminium,Aluminio,Hliník +silicon,Krzem,Silicon,Silizium,Silicio,Křemík +titanium,Tytan,Titanium,Titanio,Titan,Titan +uranium,Uran,Uranium,Uran,Urano,Uran +platinum,Platyna,Platinum,Platin,Platino,Platina +helium-3,Hel-3,Helium-3,Helium-3,Helio-3,Helium-3 +neutronium,Neutronium,Neutronium,Neutronium,Neutronio,Neutronium +quantium,Kwant,Quantium,Quantium,Cuantio,Kvantium +aetherium,Eteryt,Aetherium,Ätherium,Éterio,Eterium +stardust,Pył gwiezdny,Stardust,Sternenstaub,Polvo estelar,Hvězdný prach +xenonite,Ksenonit,Xenonite,Xenonit,Xenonita,Xenonit +solarium,Solarium,Solarium,Solarium,Solario,Solárium +chronite,Chronit,Chronite,Chronit,Cronita,Chronit \ No newline at end of file diff --git a/project.godot b/project.godot index 3caefa2..1220b78 100644 --- a/project.godot +++ b/project.godot @@ -22,6 +22,7 @@ MusicManager="*res://music_manager.gd" ObjectNames="*res://scripts/ObjectNames.gd" Settings="*res://scripts/settings.gd" GameData="*res://scripts/GameData.gd" +BuildingsList="*res://scripts/BuildingsList.gd" [display] diff --git a/scripts/BuildingsList.gd b/scripts/BuildingsList.gd new file mode 100644 index 0000000..9b5a744 --- /dev/null +++ b/scripts/BuildingsList.gd @@ -0,0 +1,22 @@ +extends Node + +const BUILDINGS = { + "iron_mine": { + "name": "Kopalnia żelaza", + "description": "Pozwala wydobywać żelazo z powierzchni planety.", + "resource": "iron", + "cost": {"iron": 100, "carbon": 50}, + "build_time": 10.0, + "texture": "res://assets/buildings/iron_mine.png", + "required_tech": null + }, + "water_purifier": { + "name": "Oczyszczalnia wody", + "description": "Pozwala wydobywać i oczyszczać wodę do użytku kolonii.", + "resource": "water", + "cost": {"iron": 80, "carbon": 40}, + "build_time": 8.0, + "texture": "res://assets/buildings/water_purifier.png", + "required_tech": null + } +} diff --git a/scripts/BuildingsList.gd.uid b/scripts/BuildingsList.gd.uid new file mode 100644 index 0000000..58cf671 --- /dev/null +++ b/scripts/BuildingsList.gd.uid @@ -0,0 +1 @@ +uid://bj48w78fvbrs3 diff --git a/scripts/dictionary.gd b/scripts/dictionary.gd index 4ecfa87..931c680 100644 --- a/scripts/dictionary.gd +++ b/scripts/dictionary.gd @@ -1,15 +1,28 @@ extends Node const RESOURCE_TYPES = [ - {"name": "iron", "chance": 90}, - {"name": "uran", "chance": 30}, - {"name": "titan", "chance": 40}, - {"name": "alu", "chance": 60}, - {"name": "water", "chance": 70} + {"name": "iron", "chance": 90}, # żelazo – powszechne + {"name": "copper", "chance": 80}, # miedź – bardzo częsta + {"name": "water", "chance": 75}, # woda – potrzebna do życia + {"name": "carbon", "chance": 70}, # węgiel – podstawowy pierwiastek + {"name": "aluminium", "chance": 45}, # lekki metal + {"name": "silicon", "chance": 40}, # do elektroniki + {"name": "titanium", "chance": 35}, # mocny, ale rzadszy + {"name": "uranium", "chance": 20}, # radioaktywny, cenny + {"name": "platinum", "chance": 20}, # szlachetny metal + {"name": "helium-3", "chance": 15}, # paliwo przyszłości + {"name": "neutronium", "chance": 15}, # ultra-gęsty materiał + {"name": "quantium", "chance": 12}, # niestabilny pierwiastek kwantowy + {"name": "aetherium", "chance": 10}, # energetyczny surowiec z wymiaru Aether + {"name": "stardust", "chance": 7}, # kosmiczny pył o właściwościach magicznych + {"name": "xenonite", "chance": 6}, # materiał używany przez obce cywilizacje + {"name": "solarium", "chance": 5}, # czysta energia słoneczna w postaci stałej + {"name": "chronite", "chance": 2} # minerał manipulujący czasem ] + const sector_names = [ "Aetherion", "Altaris", "Andur System", "Artemis Reach", "Astrion", "Azura Prime", "Borealis Expanse", "Caldris Belt", "Canthar System", "Celion Verge", diff --git a/scripts/galaxy.gd b/scripts/galaxy.gd index db5580a..254f177 100644 --- a/scripts/galaxy.gd +++ b/scripts/galaxy.gd @@ -1,8 +1,8 @@ extends Node2D -@onready var StarScene = preload("res://scenes/Star.tscn") -@onready var PlanetScene = preload("res://scenes/Planet.tscn") -@onready var MenuScene = preload("res://scenes/Menu.tscn") +@onready var StarScene = preload("res://scenes/star.tscn") +@onready var PlanetScene = preload("res://scenes/planet.tscn") +@onready var MenuScene = preload("res://scenes/menu.tscn") @onready var camera = $Camera2D @onready var TimeDispaly = $CanvasLayer2 diff --git a/scripts/planet.gd b/scripts/planet.gd index 302c3fe..bf01556 100644 --- a/scripts/planet.gd +++ b/scripts/planet.gd @@ -19,6 +19,9 @@ var max_pop = 1 var population: int = 0 var res_rich: float = 0.0 var resources := {} +var buildings := [] + # słownik z ID -> stan budynku + var texture: Texture2D var angle = randf() * TAU @@ -32,6 +35,15 @@ func _ready(): area.connect("input_event", Callable(self, "_on_area_input")) #str(round(biosfere * 100) / 100.0) _update_position() + + # Testowanie funkcji + add_building("iron_mine") + add_building("water_purifier") + add_building("iron_mine") # próba dodania ponownie + + print("Lista budynków na planecie:", buildings) + var data = BuildingsList.BUILDINGS["iron_mine"] + print(data.name, data.cost) func _process(delta): @@ -44,6 +56,7 @@ func _process(delta): _res_consumption(delta) print_data() label.text = str(pname) + update_buildings(delta) func _update_position(): # pozycja lokalna względem gwiazdy @@ -113,10 +126,21 @@ func _res_growth(delta): for res_name in resources.keys(): var res = resources[res_name] + if res.exist: - var growth = check_growth() - res.amount += growth - resources[res_name] = res + # Sprawdź, czy planeta ma budynek wydobywający ten surowiec + var can_produce = false + for b in buildings: + if not b.is_building: # tylko ukończone budynki + var building_data = BuildingsList.BUILDINGS[b.id] + if building_data.resource == res_name: + can_produce = true + break + + if can_produce: + var growth = check_growth() # np. funkcja zwraca ile przyrasta + res.amount += growth + resources[res_name] = res func check_growth() -> float: @@ -134,3 +158,33 @@ func _res_consumption(delta): if resources["water"].amount < 0: resources["water"].amount = 0 cons_timer = 0.0 + +func add_building(building_id: String): + # Sprawdzenie czy istnieje w definicjach + if not BuildingsList.BUILDINGS.has(building_id): + print("Nie ma takiego budynku:", building_id) + return + + # Sprawdzenie czy planeta już ma ten budynek + for b in buildings: + if b.id == building_id: + print("Planeta już ma budynek:", building_id) + return + + # Dodajemy budynek w budowie + buildings.append({ + "id": building_id, + "level": 1, + "is_building": true, + "built_time": 0.0 + }) + print("Rozpoczęto budowę budynku:", BuildingsList.BUILDINGS[building_id].name) + +func update_buildings(delta: float): + for b in buildings: + if b.is_building: + var build_time = BuildingsList.BUILDINGS[b.id].build_time + b.built_time += delta + if b.built_time >= build_time: + b.is_building = false + print("Budowa ukończona:", BuildingsList.BUILDINGS[b.id].name)