Reset workers after prestige in momastery and alchemy tower
This commit is contained in:
@@ -601,6 +601,7 @@ func reset_for_prestige(reset_total_currency: bool = false, emit_currency_signal
|
||||
var research_ids: Array = research_xp.keys()
|
||||
research_xp.clear()
|
||||
research_levels.clear()
|
||||
research_workers = 0
|
||||
|
||||
for research_id in research_ids:
|
||||
research_xp_changed.emit(research_id, BigNumber.from_float(0.0))
|
||||
|
||||
@@ -185,6 +185,7 @@ func perform_prestige() -> bool:
|
||||
game_state.reset_for_prestige(true, false, preserve_currencies)
|
||||
_reset_all_buff_levels()
|
||||
_reinitialize_generators_after_prestige_reset()
|
||||
_reset_alchemy_workers_after_prestige()
|
||||
if game_state:
|
||||
game_state.emit_currency_changed_for_all()
|
||||
_initialize_run_tracking_from_current_state()
|
||||
@@ -469,6 +470,16 @@ func _reinitialize_generators_after_prestige_reset() -> void:
|
||||
|
||||
generator_node.call("reset_runtime_state_for_prestige")
|
||||
|
||||
func _reset_alchemy_workers_after_prestige() -> void:
|
||||
var scene_root: Node = get_tree().current_scene
|
||||
if scene_root == null:
|
||||
return
|
||||
|
||||
var alchemy_panels: Array[Node] = scene_root.find_children("*", "AlchemyCurrenciesPanel", true, false)
|
||||
for panel in alchemy_panels:
|
||||
if panel != null and panel.has_method("reset_workers"):
|
||||
panel.reset_workers()
|
||||
|
||||
func _deserialize_big_number(raw_value: Variant) -> BigNumber:
|
||||
if raw_value is Dictionary:
|
||||
return BigNumber.deserialize(raw_value)
|
||||
|
||||
Reference in New Issue
Block a user