diff --git a/core/level_game_state.gd b/core/level_game_state.gd index 672ad87..11ca5bf 100644 --- a/core/level_game_state.gd +++ b/core/level_game_state.gd @@ -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)) diff --git a/core/prestige/prestige_manager.gd b/core/prestige/prestige_manager.gd index 9b04968..cd20d71 100644 --- a/core/prestige/prestige_manager.gd +++ b/core/prestige/prestige_manager.gd @@ -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) diff --git a/docs/gyms/tiny_sword/buffs/ts_buff_catalogue.tres b/docs/gyms/tiny_sword/buffs/ts_buff_catalogue.tres index 2e119f1..dfb6b7a 100644 --- a/docs/gyms/tiny_sword/buffs/ts_buff_catalogue.tres +++ b/docs/gyms/tiny_sword/buffs/ts_buff_catalogue.tres @@ -7,9 +7,9 @@ [ext_resource type="Resource" uid="uid://bjc6qmvr7pe12" path="res://docs/gyms/tiny_sword/buffs/spawn_worker_buff.tres" id="4_hnq3m"] [ext_resource type="Resource" uid="uid://cg7os1rfknw05" path="res://docs/gyms/tiny_sword/buffs/farm_auto_flux_buff.tres" id="5_mii30"] [ext_resource type="Resource" uid="uid://kamgujbqqhg3" path="res://docs/gyms/tiny_sword/buffs/forestry_auto_flux_buff.tres" id="6_k5yi4"] -[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buffs/fertile_infusion_buff.tres" id="7_fertile"] -[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buffs/sylvan_cognite_buff.tres" id="8_sylvan"] -[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buffs/opus_magnum_buff.tres" id="9_opus"] +[ext_resource type="Resource" uid="uid://c0ed8k5nlm22p" path="res://docs/gyms/tiny_sword/buffs/fertile_infusion_buff.tres" id="7_fertile"] +[ext_resource type="Resource" uid="uid://bkqosgm72sb8w" path="res://docs/gyms/tiny_sword/buffs/sylvan_cognite_buff.tres" id="8_sylvan"] +[ext_resource type="Resource" uid="uid://xdr3fma7h2b6" path="res://docs/gyms/tiny_sword/buffs/opus_magnum_buff.tres" id="9_opus"] [ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buffs/barracks_gold_boost_buff.tres" id="10_wc"] [ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buffs/barracks_food_boost_buff.tres" id="11_sl"] [ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buffs/barracks_wood_boost_buff.tres" id="12_sw"] diff --git a/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel.gd b/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel.gd index e605372..b964c60 100644 --- a/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel.gd +++ b/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel.gd @@ -159,3 +159,9 @@ func _on_assign_button_pressed() -> void: func _on_craft_button_pressed(recipe: Variant) -> void: craft_requested.emit(recipe) + +## Called by PrestigeManager after prestige to reset assigned alchemy workers. +func reset_workers() -> void: + _alchemy_worker_count = 0 + _update_worker_display() + alchemy_workers_changed.emit(0) diff --git a/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower.tscn b/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower.tscn index ebeeae8..7596d75 100644 --- a/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower.tscn +++ b/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower.tscn @@ -25,6 +25,7 @@ position = Vector2(0.5, 11) shape = SubResource("RectangleShape2D_8pntr") [node name="AlchemyCurrenciesPanel" parent="." unique_id=731368154 instance=ExtResource("2_8pntr")] +z_index = 1 visible = false offset_left = 44.0 offset_top = -81.0 diff --git a/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower_data.tres b/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower_data.tres index deb69f2..0cc25b4 100644 --- a/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower_data.tres +++ b/docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower_data.tres @@ -4,3 +4,4 @@ [resource] script = ExtResource("1_data") +max_workers = 0 diff --git a/docs/gyms/tiny_sword/buildings/barracks/barracks.tscn b/docs/gyms/tiny_sword/buildings/barracks/barracks.tscn index 1b816d5..69a7150 100644 --- a/docs/gyms/tiny_sword/buildings/barracks/barracks.tscn +++ b/docs/gyms/tiny_sword/buildings/barracks/barracks.tscn @@ -29,6 +29,7 @@ position = Vector2(1, 19.5) shape = SubResource("RectangleShape2D_barracks") [node name="GeneratorContainer" parent="." unique_id=1905754561 node_paths=PackedStringArray("_generator") instance=ExtResource("5_panel")] +z_index = 1 visible = false offset_left = 70.0 offset_top = -100.0 diff --git a/docs/gyms/tiny_sword/buildings/castle/castle.tscn b/docs/gyms/tiny_sword/buildings/castle/castle.tscn index 11a0274..994958f 100644 --- a/docs/gyms/tiny_sword/buildings/castle/castle.tscn +++ b/docs/gyms/tiny_sword/buildings/castle/castle.tscn @@ -23,16 +23,17 @@ position = Vector2(1, 22) shape = SubResource("RectangleShape2D_tgvch") [node name="PrestigePanel" parent="." unique_id=245519778 instance=ExtResource("3_l7gct")] -offset_left = 161.0 -offset_top = -232.0 -offset_right = 581.0 -offset_bottom = -3.0 +z_index = 1 +offset_left = 142.0 +offset_right = 562.0 +offset_bottom = 229.0 [node name="PanelContainer" type="PanelContainer" parent="." unique_id=549346899] -offset_left = 160.0 -offset_top = 5.0 -offset_right = 575.0 -offset_bottom = 201.0 +z_index = 1 +offset_left = 142.0 +offset_top = -201.0 +offset_right = 557.0 +offset_bottom = -5.0 size_flags_horizontal = 3 size_flags_vertical = 3 diff --git a/docs/gyms/tiny_sword/buildings/devil_idol/devil_idol.tscn b/docs/gyms/tiny_sword/buildings/devil_idol/devil_idol.tscn index 6be6270..91b282f 100644 --- a/docs/gyms/tiny_sword/buildings/devil_idol/devil_idol.tscn +++ b/docs/gyms/tiny_sword/buildings/devil_idol/devil_idol.tscn @@ -19,6 +19,7 @@ position = Vector2(1, 22) shape = SubResource("RectangleShape2D_idol") [node name="IdolPanel" type="PanelContainer" parent="." unique_id=906038530] +z_index = 1 offset_left = -200.0 offset_top = -120.0 offset_right = 200.0 diff --git a/docs/gyms/tiny_sword/buildings/farm/farm.tscn b/docs/gyms/tiny_sword/buildings/farm/farm.tscn index 537ded9..db32e44 100644 --- a/docs/gyms/tiny_sword/buildings/farm/farm.tscn +++ b/docs/gyms/tiny_sword/buildings/farm/farm.tscn @@ -29,6 +29,7 @@ position = Vector2(0, -2.5) shape = SubResource("RectangleShape2D_82rmq") [node name="GeneratorContainer" parent="." unique_id=1451609580 node_paths=PackedStringArray("_generator") instance=ExtResource("5_82rmq")] +z_index = 1 visible = false offset_left = 138.0 offset_top = -100.0 diff --git a/docs/gyms/tiny_sword/buildings/forestry/forestry.tscn b/docs/gyms/tiny_sword/buildings/forestry/forestry.tscn index d96e43a..00d9a49 100644 --- a/docs/gyms/tiny_sword/buildings/forestry/forestry.tscn +++ b/docs/gyms/tiny_sword/buildings/forestry/forestry.tscn @@ -29,6 +29,7 @@ position = Vector2(0.5, -2.5) shape = SubResource("RectangleShape2D_v4aq3") [node name="GeneratorContainer" parent="." unique_id=1451609580 node_paths=PackedStringArray("_generator") instance=ExtResource("5_rh3m6")] +z_index = 1 visible = false offset_left = 128.0 offset_top = -100.0 diff --git a/docs/gyms/tiny_sword/buildings/gold_mine/gold_mine.tscn b/docs/gyms/tiny_sword/buildings/gold_mine/gold_mine.tscn index 51d9601..95d1a22 100644 --- a/docs/gyms/tiny_sword/buildings/gold_mine/gold_mine.tscn +++ b/docs/gyms/tiny_sword/buildings/gold_mine/gold_mine.tscn @@ -26,6 +26,7 @@ position = Vector2(-1, -11) shape = SubResource("RectangleShape2D_sbi6i") [node name="GeneratorContainer" parent="." unique_id=1451609580 node_paths=PackedStringArray("_generator") instance=ExtResource("2_lnbxc")] +z_index = 1 visible = false offset_left = 127.0 offset_top = -103.0 diff --git a/docs/gyms/tiny_sword/buildings/monastery/monastery.tscn b/docs/gyms/tiny_sword/buildings/monastery/monastery.tscn index a33a227..7e5cfd4 100644 --- a/docs/gyms/tiny_sword/buildings/monastery/monastery.tscn +++ b/docs/gyms/tiny_sword/buildings/monastery/monastery.tscn @@ -20,6 +20,7 @@ position = Vector2(1, 16) shape = SubResource("RectangleShape2D_yyw6r") [node name="ResearchPanel" parent="." unique_id=1105274967 instance=ExtResource("3_c6gi6")] +z_index = 1 visible = false offset_left = 59.0 offset_top = -87.0