evolution

This commit is contained in:
Kirill
2026-08-02 22:57:58 +03:00
parent 8e565e5ac0
commit 9d917e95ab
+5 -6
View File
@@ -7,7 +7,7 @@ signal unlock_item(item_id: String)
var current_year: float = 0
var current_speed: int = 1
var current_speed_in_years:float = 1
var current_speed_in_years: float = 1
var entities: Dictionary[String, OwniverseEntity] = {}
var entity_groups: Dictionary[String, Array] = {}
@@ -46,12 +46,12 @@ func _auto_production(year_delta: float) -> void:
var _cycle_production = {"S": 0.0, "H": 0.0}
for entity: OwniverseEntity in auto_production:
if current_amount[entity.id] == 0:
continue
continue
_cycle_production[entity.product_per_year_type] += \
current_amount[entity.id] * entity.product_per_year_amount * year_delta
for item in _cycle_production:
_count_amount(item, _cycle_production[item])
_count_amount(item, _cycle_production[item])
func _get_distribution(source: Dictionary) -> Dictionary:
@@ -79,7 +79,7 @@ func produce(item_id: String, amount: float) -> void:
return
if _entity.cost[elem] == 0: continue
entity_transaction[elem] = -amount * _entity.cost[elem]
entity_transaction[elem] = - amount * _entity.cost[elem]
for elem in entity_transaction:
_process_enitity(elem, entity_transaction[elem])
@@ -124,7 +124,7 @@ func _count_amount(entity_id: String, amount: float) -> void:
items_to_update[entity_id] = current_amount[entity_id]
func _check_locked_items() -> void:
for entity:OwniverseEntity in locked_entities:
for entity: OwniverseEntity in locked_entities:
for elem in entity.unlock:
if cumulative_amount[elem] < entity.unlock[elem]:
continue
@@ -156,7 +156,6 @@ func change_speed(delta: int) -> int:
func load_data() -> bool:
#var _is_succesfull = false
var game_data: Dictionary = SaveManager.load_data("owniverse", "qwerty")
if game_data == {}:
return false