Budynki, wydobycie zalezen od budynku
This commit is contained in:
parent
b672646396
commit
e96bf1693f
@ -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
|
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
|
||||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
||||||
Remove-Item -Recurse -Force '{temp_dir}'"
|
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}'"
|
||||||
|
|||||||
@ -8,8 +8,19 @@ menu_save,Zapisz,Save,Speichern,Guardar,Uložit
|
|||||||
language,Język,Language,Sprache,Idioma,Jazyk
|
language,Język,Language,Sprache,Idioma,Jazyk
|
||||||
time_display,Data,Date,Datum,Fecha,Datum
|
time_display,Data,Date,Datum,Fecha,Datum
|
||||||
iron,Żelazo,Iron,Eisen,Hierro,Železo
|
iron,Żelazo,Iron,Eisen,Hierro,Železo
|
||||||
alu,Aluminium,Aluminum,Aluminium,Aluminio,Hliník
|
copper,Miedź,Copper,Kupfer,Cobre,Měď
|
||||||
titan,Tytan,Titan,Titan,Titan,Titan
|
water,Woda,Water,Wasser,Agua,Voda
|
||||||
uran,Uran,Uran,Uran,Uran,Uran
|
carbon,Węgiel,Carbon,Kohlenstoff,Carbon,Uhlík
|
||||||
anti,Antymateria,Antimatter,Antimaterie,Antimateria,Antimaterie
|
aluminium,Aluminium,Aluminium,Aluminium,Aluminio,Hliník
|
||||||
water,Woda,Water,Water,Water,Water
|
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
|
||||||
|
@ -22,6 +22,7 @@ MusicManager="*res://music_manager.gd"
|
|||||||
ObjectNames="*res://scripts/ObjectNames.gd"
|
ObjectNames="*res://scripts/ObjectNames.gd"
|
||||||
Settings="*res://scripts/settings.gd"
|
Settings="*res://scripts/settings.gd"
|
||||||
GameData="*res://scripts/GameData.gd"
|
GameData="*res://scripts/GameData.gd"
|
||||||
|
BuildingsList="*res://scripts/BuildingsList.gd"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
22
scripts/BuildingsList.gd
Normal file
22
scripts/BuildingsList.gd
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
1
scripts/BuildingsList.gd.uid
Normal file
1
scripts/BuildingsList.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://bj48w78fvbrs3
|
||||||
@ -1,15 +1,28 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
const RESOURCE_TYPES = [
|
const RESOURCE_TYPES = [
|
||||||
{"name": "iron", "chance": 90},
|
{"name": "iron", "chance": 90}, # żelazo – powszechne
|
||||||
{"name": "uran", "chance": 30},
|
{"name": "copper", "chance": 80}, # miedź – bardzo częsta
|
||||||
{"name": "titan", "chance": 40},
|
{"name": "water", "chance": 75}, # woda – potrzebna do życia
|
||||||
{"name": "alu", "chance": 60},
|
{"name": "carbon", "chance": 70}, # węgiel – podstawowy pierwiastek
|
||||||
{"name": "water", "chance": 70}
|
{"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 = [
|
const sector_names = [
|
||||||
"Aetherion", "Altaris", "Andur System", "Artemis Reach", "Astrion",
|
"Aetherion", "Altaris", "Andur System", "Artemis Reach", "Astrion",
|
||||||
"Azura Prime", "Borealis Expanse", "Caldris Belt", "Canthar System", "Celion Verge",
|
"Azura Prime", "Borealis Expanse", "Caldris Belt", "Canthar System", "Celion Verge",
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
@onready var StarScene = preload("res://scenes/Star.tscn")
|
@onready var StarScene = preload("res://scenes/star.tscn")
|
||||||
@onready var PlanetScene = preload("res://scenes/Planet.tscn")
|
@onready var PlanetScene = preload("res://scenes/planet.tscn")
|
||||||
@onready var MenuScene = preload("res://scenes/Menu.tscn")
|
@onready var MenuScene = preload("res://scenes/menu.tscn")
|
||||||
@onready var camera = $Camera2D
|
@onready var camera = $Camera2D
|
||||||
@onready var TimeDispaly = $CanvasLayer2
|
@onready var TimeDispaly = $CanvasLayer2
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,9 @@ var max_pop = 1
|
|||||||
var population: int = 0
|
var population: int = 0
|
||||||
var res_rich: float = 0.0
|
var res_rich: float = 0.0
|
||||||
var resources := {}
|
var resources := {}
|
||||||
|
var buildings := []
|
||||||
|
# słownik z ID -> stan budynku
|
||||||
|
|
||||||
|
|
||||||
var texture: Texture2D
|
var texture: Texture2D
|
||||||
var angle = randf() * TAU
|
var angle = randf() * TAU
|
||||||
@ -33,6 +36,15 @@ func _ready():
|
|||||||
#str(round(biosfere * 100) / 100.0)
|
#str(round(biosfere * 100) / 100.0)
|
||||||
_update_position()
|
_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):
|
func _process(delta):
|
||||||
angle += orbit_speed * delta # obrót w czasie
|
angle += orbit_speed * delta # obrót w czasie
|
||||||
@ -44,6 +56,7 @@ func _process(delta):
|
|||||||
_res_consumption(delta)
|
_res_consumption(delta)
|
||||||
print_data()
|
print_data()
|
||||||
label.text = str(pname)
|
label.text = str(pname)
|
||||||
|
update_buildings(delta)
|
||||||
|
|
||||||
func _update_position():
|
func _update_position():
|
||||||
# pozycja lokalna względem gwiazdy
|
# pozycja lokalna względem gwiazdy
|
||||||
@ -113,8 +126,19 @@ func _res_growth(delta):
|
|||||||
|
|
||||||
for res_name in resources.keys():
|
for res_name in resources.keys():
|
||||||
var res = resources[res_name]
|
var res = resources[res_name]
|
||||||
|
|
||||||
if res.exist:
|
if res.exist:
|
||||||
var growth = check_growth()
|
# 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
|
res.amount += growth
|
||||||
resources[res_name] = res
|
resources[res_name] = res
|
||||||
|
|
||||||
@ -134,3 +158,33 @@ func _res_consumption(delta):
|
|||||||
if resources["water"].amount < 0:
|
if resources["water"].amount < 0:
|
||||||
resources["water"].amount = 0
|
resources["water"].amount = 0
|
||||||
cons_timer = 0.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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user