diff --git a/core/generator/currency_generator.gd b/core/generator/currency_generator.gd index d73d278..83472c8 100644 --- a/core/generator/currency_generator.gd +++ b/core/generator/currency_generator.gd @@ -493,10 +493,10 @@ func _resolve_buff_cost_currency_id(buff: GeneratorBuffData) -> StringName: return GameState.get_currency_id(cost_currency) func _resolve_purchase_currency() -> Currency: - if data != null and data.purchase_currency != null: - return data.purchase_currency + if data == null: + return null - return currency + return data.purchase_currency func _resolve_buff_target_currency_id(buff: GeneratorBuffData) -> StringName: if buff == null: diff --git a/core/generator/currency_generator.tscn b/core/generator/currency_generator.tscn index 641782f..94f74dd 100644 --- a/core/generator/currency_generator.tscn +++ b/core/generator/currency_generator.tscn @@ -24,10 +24,10 @@ shape = SubResource("RectangleShape2D_y5m1q") [node name="GeneratorPanel" parent="." unique_id=1129190041 node_paths=PackedStringArray("_generator") instance=ExtResource("5_bb14m")] visible = false -offset_left = 64.0 -offset_top = -64.0 -offset_right = 505.0 -offset_bottom = 201.5 +offset_left = 33.0 +offset_top = -65.0 +offset_right = 474.0 +offset_bottom = 200.5 _generator = NodePath("..") [connection signal="mouse_entered" from="Area2D" to="." method="_on_area_2d_mouse_entered"] diff --git a/docs/gyms/generator_gym.tscn b/docs/gyms/generator_gym.tscn index ef73e49..5354038 100644 --- a/docs/gyms/generator_gym.tscn +++ b/docs/gyms/generator_gym.tscn @@ -2,6 +2,7 @@ [ext_resource type="PackedScene" uid="uid://jeoiinukrrsp" path="res://core/generator/currency_generator.tscn" id="1_6pne4"] [ext_resource type="Resource" uid="uid://bnhqk8b31mm4e" path="res://idles/currencies/knowledge.tres" id="2_8qilt"] +[ext_resource type="Resource" uid="uid://l0pn6mlcer7t" path="res://idles/currencies/spirit.tres" id="2_jlqd0"] [ext_resource type="Resource" uid="uid://04pmc034qupd" path="res://idles/generators/library.tres" id="3_4ly0e"] [ext_resource type="Resource" uid="uid://cythfovqgqlyh" path="res://idles/currencies/wood.tres" id="4_2xpf5"] [ext_resource type="PackedScene" uid="uid://btkxru2gdjsgc" path="res://currency_tile.tscn" id="4_6ri4a"] @@ -13,7 +14,7 @@ [node name="GeneratorGym" type="Node2D" unique_id=1219373683] [node name="MagicGenerator" parent="." unique_id=967969064 instance=ExtResource("1_6pne4")] -position = Vector2(249, 301) +position = Vector2(262, 301) [node name="KnowledgeGenerator" parent="." unique_id=2139088546 instance=ExtResource("1_6pne4")] visible = false @@ -24,7 +25,7 @@ press_buys_generator = false [node name="WoodGenerator" parent="." unique_id=29858558 instance=ExtResource("1_6pne4")] visible = false -position = Vector2(969, 304) +position = Vector2(1046, 626) currency = ExtResource("4_2xpf5") data = ExtResource("5_u3cug") press_buys_generator = false @@ -41,18 +42,25 @@ offset_right = 160.0 offset_bottom = 31.0 currency = ExtResource("5_dl3gy") +[node name="SpiritCurrencyTile" parent="UI" unique_id=797237056 instance=ExtResource("4_6ri4a")] +layout_mode = 0 +offset_top = 32.0 +offset_right = 160.0 +offset_bottom = 63.0 +currency = ExtResource("2_jlqd0") + [node name="KnowledgeCurrencyTile" parent="UI" unique_id=1977342362 instance=ExtResource("4_6ri4a")] layout_mode = 0 -offset_top = 28.0 +offset_top = 63.0 offset_right = 160.0 -offset_bottom = 59.0 +offset_bottom = 94.0 currency = ExtResource("2_8qilt") [node name="WoodCurrencyTile" parent="UI" unique_id=1210103101 instance=ExtResource("4_6ri4a")] layout_mode = 0 -offset_top = 59.0 +offset_top = 94.0 offset_right = 160.0 -offset_bottom = 90.0 +offset_bottom = 125.0 currency = ExtResource("4_2xpf5") [node name="GoalsDebugUI" parent="UI" unique_id=4710697 instance=ExtResource("7_7i63j")] diff --git a/generator_container.gd b/generator_container.gd index 0e9b82d..f2e1d4d 100644 --- a/generator_container.gd +++ b/generator_container.gd @@ -153,7 +153,10 @@ func _refresh_generator_ui() -> void: _owned_value.text = str(_generator.owned) if can_interact: - var purchase_currency_name: String = GameState.get_currency_name(_generator.get_purchase_currency_id()) + var purchase_currency_id: StringName = _generator.get_purchase_currency_id() + var purchase_currency_name: String = GameState.get_currency_name(purchase_currency_id) + if purchase_currency_name.is_empty(): + purchase_currency_name = "Unconfigured" _next_cost_value.text = "%s %s" % [_generator.get_next_cost().to_string_suffix(2), purchase_currency_name] else: _next_cost_value.text = "-" diff --git a/generator_container.tscn b/generator_container.tscn index d7be230..90a9c47 100644 --- a/generator_container.tscn +++ b/generator_container.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" uid="uid://es14nqk6vrrk" path="res://generator_container.gd" id="1_8wouw"] -[node name="GeneratorContainer" type="MarginContainer" unique_id=1253142977] +[node name="GeneratorContainer" type="PanelContainer" unique_id=1451609580] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -14,11 +14,14 @@ offset_right = 132.0 offset_bottom = 87.5 grow_horizontal = 2 grow_vertical = 2 -theme_override_constants/margin_left = 20 script = ExtResource("1_8wouw") -[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1868446780] +[node name="PanelContainer" type="MarginContainer" parent="." unique_id=370221865] layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 20 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer" unique_id=1139263929] layout_mode = 2 @@ -78,7 +81,5 @@ text = "Buffs" layout_mode = 2 theme_override_constants/separation = 4 -[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"] -[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"] [connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainerGenerators/BuyOneButton" to="." method="_on_buy_pressed"] [connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainerGenerators/BuyMaxButton" to="." method="_on_buy_max_pressed"] diff --git a/idles/buffs/orb_summon_spirit.tres b/idles/buffs/orb_summon_spirit.tres new file mode 100644 index 0000000..e160870 --- /dev/null +++ b/idles/buffs/orb_summon_spirit.tres @@ -0,0 +1,20 @@ +[gd_resource type="Resource" script_class="GeneratorBuffData" format=3 uid="uid://coi7k1cx4p4hr"] + +[ext_resource type="Resource" uid="uid://brqaojindcxa5" path="res://idles/currencies/magic.tres" id="1_aawxd"] +[ext_resource type="Resource" uid="uid://l0pn6mlcer7t" path="res://idles/currencies/spirit.tres" id="2_0eqxt"] +[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="3_0ov1n"] +[ext_resource type="Resource" uid="uid://qyxct5gbrxwa" path="res://idles/goals/magic_total_30.tres" id="4_ifsqd"] + +[resource] +script = ExtResource("3_0ov1n") +id = &"summon_spirit" +kind = 2 +text = "Summon Spirit" +unlock_goal = ExtResource("4_ifsqd") +effect_increment = 1.0 +cost_currency = ExtResource("1_aawxd") +base_cost_mantissa = 200.0 +cost_multiplier = 1.15 +resource_target_currency = ExtResource("2_0eqxt") +resource_purchase_base_mantissa = 1.0 +resource_purchase_increment_multiplier = 1.0 diff --git a/idles/currencies/spirit.tres b/idles/currencies/spirit.tres new file mode 100644 index 0000000..6497a2b --- /dev/null +++ b/idles/currencies/spirit.tres @@ -0,0 +1,9 @@ +[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://l0pn6mlcer7t"] + +[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="1_m14p5"] + +[resource] +script = ExtResource("1_m14p5") +id = &"spirit" +display_name = "Spirit" +metadata/_custom_type_script = "uid://dtgqjf3bl7pm8" diff --git a/idles/generators/forestry.tres b/idles/generators/forestry.tres index fa5f692..d51df71 100644 --- a/idles/generators/forestry.tres +++ b/idles/generators/forestry.tres @@ -2,7 +2,7 @@ [ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="1_ffn26"] [ext_resource type="Resource" uid="uid://mvgfe3nc7uwa" path="res://idles/buffs/bigger_forest.tres" id="2_rptf4"] -[ext_resource type="Resource" uid="uid://brqaojindcxa5" path="res://idles/currencies/magic.tres" id="4_rpydf"] +[ext_resource type="Resource" uid="uid://l0pn6mlcer7t" path="res://idles/currencies/spirit.tres" id="3_rptf4"] [ext_resource type="Script" uid="uid://b00tqsuhxdy0d" path="res://core/generator/currency_generator_data.gd" id="5_43n1y"] [ext_resource type="Resource" uid="uid://bmlhoeasl7xor" path="res://idles/goals/magic_total_13k.tres" id="6_ffn26"] @@ -13,9 +13,10 @@ name = "Forestry" starts_unlocked = false starts_available = false initial_owned = 1 -purchase_currency = ExtResource("4_rpydf") +purchase_currency = ExtResource("3_rptf4") unlock_goal = ExtResource("6_ffn26") -initial_cost = 200.0 +unlock_goal_behavior = 1 +initial_cost = 1.0 initial_productivity = 20.0 buffs = Array[ExtResource("1_ffn26")]([ExtResource("2_rptf4")]) metadata/_custom_type_script = "uid://b00tqsuhxdy0d" diff --git a/idles/generators/library.tres b/idles/generators/library.tres index ee117c6..0e5100a 100644 --- a/idles/generators/library.tres +++ b/idles/generators/library.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" script_class="CurrencyGeneratorData" format=3 uid="uid://04pmc034qupd"] [ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="1_jemvk"] -[ext_resource type="Resource" uid="uid://brqaojindcxa5" path="res://idles/currencies/magic.tres" id="2_b1n9q"] [ext_resource type="Resource" uid="uid://tu63jy51yigb" path="res://idles/buffs/library_auto_flux.tres" id="2_fcbji"] +[ext_resource type="Resource" uid="uid://l0pn6mlcer7t" path="res://idles/currencies/spirit.tres" id="3_fcbji"] [ext_resource type="Script" uid="uid://b00tqsuhxdy0d" path="res://core/generator/currency_generator_data.gd" id="3_xj12v"] [ext_resource type="Resource" uid="uid://c4mkxj4ubhsi0" path="res://idles/goals/magic_total_1300.tres" id="4_1h03m"] @@ -13,10 +13,11 @@ name = "Library" starts_unlocked = false starts_available = false initial_owned = 1 -purchase_currency = ExtResource("2_b1n9q") +purchase_currency = ExtResource("3_fcbji") unlock_goal = ExtResource("4_1h03m") unlock_goal_behavior = 1 -initial_cost = 60.0 +initial_cost = 1.0 +coefficient = 1.0 initial_time = 3.0 initial_revenue = 60.0 initial_productivity = 20.0 diff --git a/idles/generators/orb.tres b/idles/generators/orb.tres index 3f3d1b9..0420434 100644 --- a/idles/generators/orb.tres +++ b/idles/generators/orb.tres @@ -4,14 +4,16 @@ [ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="1_t6lg0"] [ext_resource type="Resource" uid="uid://ceugcxmassmpk" path="res://idles/buffs/orb_auto_flux.tres" id="2_x505b"] [ext_resource type="Resource" uid="uid://6i3fcygusuqf" path="res://idles/buffs/orb_click_focus.tres" id="3_fsxdm"] -[ext_resource type="Resource" uid="uid://brqaojindcxa5" path="res://idles/currencies/magic.tres" id="4_jpwus"] +[ext_resource type="Resource" uid="uid://coi7k1cx4p4hr" path="res://idles/buffs/orb_summon_spirit.tres" id="4_5v0af"] +[ext_resource type="Resource" uid="uid://l0pn6mlcer7t" path="res://idles/currencies/spirit.tres" id="4_jpwus"] [resource] script = ExtResource("1_c6y77") id = &"Magic" name = "Magic Orb" purchase_currency = ExtResource("4_jpwus") -initial_cost = 200.0 +initial_cost = 1.0 +coefficient = 1.0 initial_productivity = 20.0 -buffs = Array[ExtResource("1_t6lg0")]([ExtResource("2_x505b"), ExtResource("3_fsxdm")]) +buffs = Array[ExtResource("1_t6lg0")]([ExtResource("2_x505b"), ExtResource("3_fsxdm"), ExtResource("4_5v0af")]) metadata/_custom_type_script = "uid://b00tqsuhxdy0d" diff --git a/idles/generators/spirit_factory.tres b/idles/generators/spirit_factory.tres new file mode 100644 index 0000000..61ab4b3 --- /dev/null +++ b/idles/generators/spirit_factory.tres @@ -0,0 +1,18 @@ +[gd_resource type="Resource" script_class="CurrencyGeneratorData" format=3 uid="uid://ri1ggb756753"] + +[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="1_tgm58"] +[ext_resource type="Script" uid="uid://b00tqsuhxdy0d" path="res://core/generator/currency_generator_data.gd" id="2_1qpvc"] +[ext_resource type="Resource" uid="uid://brqaojindcxa5" path="res://idles/currencies/magic.tres" id="2_chq14"] +[ext_resource type="Resource" uid="uid://qyxct5gbrxwa" path="res://idles/goals/magic_total_30.tres" id="4_tj1lt"] + +[resource] +script = ExtResource("2_1qpvc") +id = &"spirit_factory" +name = "Spirit Factory" +starts_unlocked = false +starts_available = false +purchase_currency = ExtResource("2_chq14") +unlock_goal = ExtResource("4_tj1lt") +unlock_goal_behavior = 1 +initial_cost = 200.0 +metadata/_custom_type_script = "uid://b00tqsuhxdy0d"