Feature/evolution #1
@@ -7,7 +7,7 @@ signal unlock_item(item_id: String)
|
|||||||
|
|
||||||
var current_year: float = 0
|
var current_year: float = 0
|
||||||
var current_speed: int = 1
|
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 entities: Dictionary[String, OwniverseEntity] = {}
|
||||||
var entity_groups: Dictionary[String, Array] = {}
|
var entity_groups: Dictionary[String, Array] = {}
|
||||||
@@ -79,7 +79,7 @@ func produce(item_id: String, amount: float) -> void:
|
|||||||
return
|
return
|
||||||
if _entity.cost[elem] == 0: continue
|
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:
|
for elem in entity_transaction:
|
||||||
_process_enitity(elem, entity_transaction[elem])
|
_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]
|
items_to_update[entity_id] = current_amount[entity_id]
|
||||||
|
|
||||||
func _check_locked_items() -> void:
|
func _check_locked_items() -> void:
|
||||||
for entity:OwniverseEntity in locked_entities:
|
for entity: OwniverseEntity in locked_entities:
|
||||||
for elem in entity.unlock:
|
for elem in entity.unlock:
|
||||||
if cumulative_amount[elem] < entity.unlock[elem]:
|
if cumulative_amount[elem] < entity.unlock[elem]:
|
||||||
continue
|
continue
|
||||||
@@ -156,7 +156,6 @@ func change_speed(delta: int) -> int:
|
|||||||
|
|
||||||
func load_data() -> bool:
|
func load_data() -> bool:
|
||||||
#var _is_succesfull = false
|
#var _is_succesfull = false
|
||||||
|
|
||||||
var game_data: Dictionary = SaveManager.load_data("owniverse", "qwerty")
|
var game_data: Dictionary = SaveManager.load_data("owniverse", "qwerty")
|
||||||
if game_data == {}:
|
if game_data == {}:
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user