Improve prestige buff
This commit is contained in:
@@ -10,7 +10,6 @@ var _connections: Array = []
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
|
||||||
|
|
||||||
## Replace all connections and redraw.
|
## Replace all connections and redraw.
|
||||||
func set_connections(connections: Array) -> void:
|
func set_connections(connections: Array) -> void:
|
||||||
_connections = connections
|
_connections = connections
|
||||||
|
|||||||
@@ -52,13 +52,13 @@ func _refresh_connections() -> void:
|
|||||||
_connection_overlay.set_connections(connections)
|
_connection_overlay.set_connections(connections)
|
||||||
|
|
||||||
|
|
||||||
## Recursively collects all PrestigeBuffGraphTile nodes from a container.
|
## Collects all PrestigeBuffGraphTile nodes rooted at `from`, recursing into every child.
|
||||||
func _collect_tiles(from: Node, out_tiles: Array[PrestigeBuffGraphTile]) -> void:
|
func _collect_tiles(from: Node, out_tiles: Array[PrestigeBuffGraphTile]) -> void:
|
||||||
for child in from.get_children():
|
var found: Array[Node] = from.find_children("*", "PrestigeBuffGraphTile", true, false)
|
||||||
if child is PrestigeBuffGraphTile:
|
for node in found:
|
||||||
out_tiles.append(child)
|
var tile := node as PrestigeBuffGraphTile
|
||||||
elif child is Container:
|
if tile:
|
||||||
_collect_tiles(child, out_tiles)
|
out_tiles.append(tile)
|
||||||
|
|
||||||
func _refresh_balance() -> void:
|
func _refresh_balance() -> void:
|
||||||
if _game_state == null:
|
if _game_state == null:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ script = ExtResource("1_script")
|
|||||||
id = &"farm_boost"
|
id = &"farm_boost"
|
||||||
display_name = "Fertile Grounds"
|
display_name = "Fertile Grounds"
|
||||||
description = "Permanently increases farm food production."
|
description = "Permanently increases farm food production."
|
||||||
effect_value = 1.5
|
parent_ids = Array[StringName]([&"gold_boost"])
|
||||||
|
effect_value = 2.0
|
||||||
target_id = &"farm"
|
target_id = &"farm"
|
||||||
x_position = 1.0
|
x_position = 1.0
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ script = ExtResource("1_script")
|
|||||||
id = &"gold_boost"
|
id = &"gold_boost"
|
||||||
display_name = "Golden Touch"
|
display_name = "Golden Touch"
|
||||||
description = "Permanently increases gold mine production."
|
description = "Permanently increases gold mine production."
|
||||||
effect_value = 1.5
|
effect_value = 2.0
|
||||||
target_id = &"goldmine"
|
target_id = &"goldmine"
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
[gd_scene format=3 uid="uid://dprbgokqitaav"]
|
[gd_scene format=3 uid="uid://dprbgokqitaav"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://core/prestige/prestige_buff_graph_panel.gd" id="1_panel"]
|
[ext_resource type="Script" uid="uid://n01pkakxllnj" path="res://core/prestige/prestige_buff_graph_panel.gd" id="1_panel"]
|
||||||
[ext_resource type="Script" path="res://core/prestige/prestige_buff_connection_overlay.gd" id="2_overlay"]
|
[ext_resource type="Script" uid="uid://uv5lxj6hmpk" path="res://core/prestige/prestige_buff_connection_overlay.gd" id="2_overlay"]
|
||||||
[ext_resource type="PackedScene" path="res://core/prestige/prestige_buff_graph_tile.tscn" id="3_tile"]
|
[ext_resource type="PackedScene" uid="uid://bqk8rwia7lpbg" path="res://core/prestige/prestige_buff_graph_tile.tscn" id="3_tile"]
|
||||||
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres" id="4_gold"]
|
[ext_resource type="Resource" uid="uid://vl3ot4t876pc" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres" id="4_gold"]
|
||||||
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres" id="5_farm"]
|
[ext_resource type="Resource" uid="uid://cvogxo0msis2w" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres" id="5_farm"]
|
||||||
|
|
||||||
[node name="PrestigeBuffGraphPanel" type="PanelContainer" unique_id=947835716]
|
[node name="PrestigeBuffGraphPanel" type="PanelContainer" unique_id=947835716]
|
||||||
visible = false
|
|
||||||
custom_minimum_size = Vector2(600, 400)
|
custom_minimum_size = Vector2(600, 400)
|
||||||
script = ExtResource("1_panel")
|
script = ExtResource("1_panel")
|
||||||
|
|
||||||
@@ -26,19 +25,19 @@ layout_mode = 2
|
|||||||
|
|
||||||
[node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer/Header" unique_id=518293746]
|
[node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer/Header" unique_id=518293746]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Prestige Buffs"
|
|
||||||
theme_override_font_sizes/font_size = 20
|
theme_override_font_sizes/font_size = 20
|
||||||
|
text = "Prestige Buffs"
|
||||||
|
|
||||||
[node name="CloseButton" type="Button" parent="MarginContainer/VBoxContainer/Header" unique_id=184756392]
|
[node name="CloseButton" type="Button" parent="MarginContainer/VBoxContainer/Header" unique_id=184756392]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 10
|
size_flags_horizontal = 10
|
||||||
text = "✕"
|
|
||||||
theme_override_font_sizes/font_size = 16
|
theme_override_font_sizes/font_size = 16
|
||||||
|
text = "✕"
|
||||||
|
|
||||||
[node name="BalanceLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=293847561]
|
[node name="BalanceLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=293847561]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Prestige Currency: 0"
|
|
||||||
theme_override_font_sizes/font_size = 14
|
theme_override_font_sizes/font_size = 14
|
||||||
|
text = "Prestige Currency: 0"
|
||||||
|
|
||||||
[node name="TilesArea" type="Control" parent="MarginContainer/VBoxContainer" unique_id=847291034]
|
[node name="TilesArea" type="Control" parent="MarginContainer/VBoxContainer" unique_id=847291034]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -50,27 +49,21 @@ layout_mode = 1
|
|||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
grow_horizontal = 1
|
grow_horizontal = 2
|
||||||
grow_vertical = 1
|
grow_vertical = 2
|
||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
script = ExtResource("2_overlay")
|
script = ExtResource("2_overlay")
|
||||||
|
|
||||||
[node name="TiersContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TilesArea" unique_id=129384756]
|
[node name="GoldBoostTile" parent="MarginContainer/VBoxContainer/TilesArea" unique_id=756192834 instance=ExtResource("3_tile")]
|
||||||
layout_mode = 1
|
layout_mode = 0
|
||||||
anchors_preset = 15
|
offset_right = 220.0
|
||||||
anchor_right = 1.0
|
offset_bottom = 100.0
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 1
|
|
||||||
grow_vertical = 1
|
|
||||||
|
|
||||||
[node name="Tier0" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TilesArea/TiersContainer" unique_id=384756192]
|
|
||||||
layout_mode = 2
|
|
||||||
theme_override_constants/separation = 8
|
|
||||||
|
|
||||||
[node name="GoldBoostTile" parent="MarginContainer/VBoxContainer/TilesArea/TiersContainer/Tier0" unique_id=756192834 instance=ExtResource("3_tile")]
|
|
||||||
layout_mode = 2
|
|
||||||
prestige_buff = ExtResource("4_gold")
|
prestige_buff = ExtResource("4_gold")
|
||||||
|
|
||||||
[node name="FarmBoostTile" parent="MarginContainer/VBoxContainer/TilesArea/TiersContainer/Tier0" unique_id=619283475 instance=ExtResource("3_tile")]
|
[node name="FarmBoostTile" parent="MarginContainer/VBoxContainer/TilesArea" unique_id=619283475 instance=ExtResource("3_tile")]
|
||||||
layout_mode = 2
|
layout_mode = 0
|
||||||
|
offset_left = 3.0
|
||||||
|
offset_top = 121.0
|
||||||
|
offset_right = 223.0
|
||||||
|
offset_bottom = 221.0
|
||||||
prestige_buff = ExtResource("5_farm")
|
prestige_buff = ExtResource("5_farm")
|
||||||
|
|||||||
@@ -7,5 +7,6 @@ script = ExtResource("1_42hk5")
|
|||||||
id = &"wood_boost"
|
id = &"wood_boost"
|
||||||
display_name = "Wood Touch"
|
display_name = "Wood Touch"
|
||||||
description = "Permanently increases forestry production."
|
description = "Permanently increases forestry production."
|
||||||
effect_value = 1.5
|
parent_ids = Array[StringName]([&"farm_boost"])
|
||||||
|
effect_value = 2.0
|
||||||
target_id = &"forestry"
|
target_id = &"forestry"
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ toggle_mode = true
|
|||||||
text = "Prestige Buffs"
|
text = "Prestige Buffs"
|
||||||
|
|
||||||
[node name="PrestigeBuffGraphPanel" parent="LevelGameState/CanvasLayer/UI" unique_id=847291035 instance=ExtResource("18_pnl")]
|
[node name="PrestigeBuffGraphPanel" parent="LevelGameState/CanvasLayer/UI" unique_id=847291035 instance=ExtResource("18_pnl")]
|
||||||
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
offset_left = 400.0
|
offset_left = 400.0
|
||||||
offset_top = 200.0
|
offset_top = 200.0
|
||||||
|
|||||||
Reference in New Issue
Block a user