Nauka + budynek naukowy
This commit is contained in:
parent
2f5067d7e5
commit
6be0033f7c
BIN
assets/buildings/labolatory.png
Normal file
BIN
assets/buildings/labolatory.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
40
assets/buildings/labolatory.png.import
Normal file
40
assets/buildings/labolatory.png.import
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://de5drs5j21a34"
|
||||||
|
path="res://.godot/imported/labolatory.png-fa4bdd4a0ce66e3be36171e95748be48.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/buildings/labolatory.png"
|
||||||
|
dest_files=["res://.godot/imported/labolatory.png-fa4bdd4a0ce66e3be36171e95748be48.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
@ -34,3 +34,7 @@ text = "ddfdf"
|
|||||||
[node name="Technologies" type="Button" parent="HBoxContainer"]
|
[node name="Technologies" type="Button" parent="HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Technologies"
|
text = "Technologies"
|
||||||
|
|
||||||
|
[node name="SinceLabel" type="Label" parent="HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "ddfdf"
|
||||||
|
|||||||
@ -72,6 +72,18 @@ var BUILDINGS = {
|
|||||||
"build_time": 5.0,
|
"build_time": 5.0,
|
||||||
"texture": "res://assets/buildings/terraforming_center.png",
|
"texture": "res://assets/buildings/terraforming_center.png",
|
||||||
"required_tech": null
|
"required_tech": null
|
||||||
|
},
|
||||||
|
"laboratory": {
|
||||||
|
"name": "Laboratory",
|
||||||
|
"description": "Umożliwia prace naukowe",
|
||||||
|
"bonuses": {
|
||||||
|
|
||||||
|
},
|
||||||
|
"resource": null,
|
||||||
|
"cost": {"iron": 10},
|
||||||
|
"build_time": 5.0,
|
||||||
|
"texture": "res://assets/buildings/labolatory.png",
|
||||||
|
"required_tech": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ var resources := {
|
|||||||
"chronite": 0.0,
|
"chronite": 0.0,
|
||||||
}
|
}
|
||||||
|
|
||||||
var science_points: float = 0.0
|
var since_doc: float = 0.0
|
||||||
|
|
||||||
# Technologie odkryte
|
# Technologie odkryte
|
||||||
var unlocked_techs = ["advanced_mining"]
|
var unlocked_techs = ["advanced_mining"]
|
||||||
|
|||||||
@ -49,6 +49,10 @@ func _generate_galaxy(count: int):
|
|||||||
planet.pname = Names.planet_names[randi() % Names.planet_names.size()]
|
planet.pname = Names.planet_names[randi() % Names.planet_names.size()]
|
||||||
planet.orbit_radius = 55 + j * 40
|
planet.orbit_radius = 55 + j * 40
|
||||||
planet.orbit_speed = randf_range(0.004, 0.01)
|
planet.orbit_speed = randf_range(0.004, 0.01)
|
||||||
|
planet.since_potential = 0.1 + (2.0 - 0.1) * pow(randf(), 4.0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
planet.size = randi_range(1, 3)
|
planet.size = randi_range(1, 3)
|
||||||
#assign_max_population(planet)
|
#assign_max_population(planet)
|
||||||
generate_planet_resources(planet) # <-- tu losujemy surowce
|
generate_planet_resources(planet) # <-- tu losujemy surowce
|
||||||
|
|||||||
@ -8,6 +8,7 @@ class_name Planet
|
|||||||
var pop_timer: float = 0.0
|
var pop_timer: float = 0.0
|
||||||
var res_timer: float = 0.0
|
var res_timer: float = 0.0
|
||||||
var cons_timer: float = 0.0
|
var cons_timer: float = 0.0
|
||||||
|
var since_pop: float = 0.0
|
||||||
|
|
||||||
var pname: String = ""
|
var pname: String = ""
|
||||||
var orbit_radius: float = 30.0
|
var orbit_radius: float = 30.0
|
||||||
@ -18,6 +19,8 @@ var size = 1
|
|||||||
var max_pop = 1
|
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 since_doc: float = 0.0
|
||||||
|
var since_potential: float = 0.5
|
||||||
var resources := {}
|
var resources := {}
|
||||||
var buildings := []
|
var buildings := []
|
||||||
var bonuses = {
|
var bonuses = {
|
||||||
@ -55,6 +58,7 @@ func _process(delta):
|
|||||||
if is_colonized:
|
if is_colonized:
|
||||||
_pop_growth(delta)
|
_pop_growth(delta)
|
||||||
_res_growth(delta)
|
_res_growth(delta)
|
||||||
|
_since_growth(delta)
|
||||||
_res_consumption(delta)
|
_res_consumption(delta)
|
||||||
print_data()
|
print_data()
|
||||||
label.text = str(pname)
|
label.text = str(pname)
|
||||||
@ -145,6 +149,24 @@ func _pop_growth(delta):
|
|||||||
else:
|
else:
|
||||||
population = max(population - 1000, 100)
|
population = max(population - 1000, 100)
|
||||||
pop_timer = 0.0
|
pop_timer = 0.0
|
||||||
|
func _since_growth(delta):
|
||||||
|
since_pop += delta
|
||||||
|
if since_pop >= Settings.UPDATE_INTERVAL:
|
||||||
|
if has_building("laboratory"):
|
||||||
|
since_doc += since_potential * log(1 + population * 0.00001)
|
||||||
|
since_pop = 0
|
||||||
|
|
||||||
|
|
||||||
|
func has_building(building_id: String) -> bool:
|
||||||
|
for b in buildings:
|
||||||
|
if typeof(b) == TYPE_DICTIONARY:
|
||||||
|
if b.get("id", "") == building_id:
|
||||||
|
return true
|
||||||
|
# jeśli trzymasz budynki jako stringi (rzadziej), obsłuż to też:
|
||||||
|
elif typeof(b) == TYPE_STRING and b == building_id:
|
||||||
|
return true
|
||||||
|
return false
|
||||||
|
|
||||||
func _res_growth(delta):
|
func _res_growth(delta):
|
||||||
res_timer += delta
|
res_timer += delta
|
||||||
if res_timer < Settings.UPDATE_INTERVAL:
|
if res_timer < Settings.UPDATE_INTERVAL:
|
||||||
|
|||||||
@ -33,10 +33,11 @@ func _update_info():
|
|||||||
text += "Biosfera: %.2f (+%.2f)\n" % [planet.biosfere, planet.bonuses.get("biosfere", 0.0)]
|
text += "Biosfera: %.2f (+%.2f)\n" % [planet.biosfere, planet.bonuses.get("biosfere", 0.0)]
|
||||||
|
|
||||||
text += "Zasobność surowców: %.2f\n" % planet.res_rich
|
text += "Zasobność surowców: %.2f\n" % planet.res_rich
|
||||||
|
text += "Potencjał naukowy: %.2f\n" % planet.since_potential
|
||||||
text += "Limit populacji: %s\n" % GameData.format_number(planet.max_pop)
|
text += "Limit populacji: %s\n" % GameData.format_number(planet.max_pop)
|
||||||
text += "Populacja: %d\n" % int(planet.population)
|
text += "Populacja: %d\n" % int(planet.population)
|
||||||
text += "Status: %s\n" % ("Skolonizowana" if planet.is_colonized else "Nieskolonizowana")
|
text += "Status: %s\n" % ("Skolonizowana" if planet.is_colonized else "Nieskolonizowana")
|
||||||
|
text += "Raporty naukowe: %.2f\n" % planet.since_doc
|
||||||
# Surowce
|
# Surowce
|
||||||
var has_any_resource = false
|
var has_any_resource = false
|
||||||
for key in planet.resources.keys():
|
for key in planet.resources.keys():
|
||||||
@ -130,7 +131,8 @@ func _on_send_resources_pressed():
|
|||||||
|
|
||||||
if not planet:
|
if not planet:
|
||||||
return
|
return
|
||||||
|
PlayerData.since_doc += planet.since_doc
|
||||||
|
planet.since_doc = 0
|
||||||
for res_name in planet.resources.keys():
|
for res_name in planet.resources.keys():
|
||||||
var res = planet.resources[res_name]
|
var res = planet.resources[res_name]
|
||||||
if res.has("amount") and res["amount"] > 0:
|
if res.has("amount") and res["amount"] > 0:
|
||||||
|
|||||||
@ -5,6 +5,7 @@ extends Control
|
|||||||
@onready var label_iron = $HBoxContainer/IronLabel
|
@onready var label_iron = $HBoxContainer/IronLabel
|
||||||
@onready var label_water = $HBoxContainer/WaterLabel
|
@onready var label_water = $HBoxContainer/WaterLabel
|
||||||
@onready var label_copper = $HBoxContainer/CopperLabel
|
@onready var label_copper = $HBoxContainer/CopperLabel
|
||||||
|
@onready var label_since = $HBoxContainer/SinceLabel
|
||||||
#@onready var label_population = $HBoxContainer/LabelPopulation
|
#@onready var label_population = $HBoxContainer/LabelPopulation
|
||||||
|
|
||||||
func update_info():
|
func update_info():
|
||||||
@ -15,6 +16,7 @@ func update_info():
|
|||||||
label_iron.text = "%s: %.2f" % [tr("iron"), PlayerData.resources.iron]
|
label_iron.text = "%s: %.2f" % [tr("iron"), PlayerData.resources.iron]
|
||||||
label_water.text = "%s: %.2f" % [tr("water"), PlayerData.resources.water]
|
label_water.text = "%s: %.2f" % [tr("water"), PlayerData.resources.water]
|
||||||
label_copper.text = "%s: %.2f" % [tr("copper"), PlayerData.resources.copper]
|
label_copper.text = "%s: %.2f" % [tr("copper"), PlayerData.resources.copper]
|
||||||
|
label_since.text = "%s: %.2f" % [tr("since"), PlayerData.since_doc]
|
||||||
|
|
||||||
|
|
||||||
#label_population.text = "👥 Populacja: %s" % GameData.format_number(player.total_population)
|
#label_population.text = "👥 Populacja: %s" % GameData.format_number(player.total_population)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user