@@ -7,6 +7,18 @@ onready var slots = $Slots
7
7
onready var inventory = $ Inventory
8
8
onready var description = $ Description
9
9
10
+ const SOUL_DESCRIPTIONS = {
11
+ "trigger" : "Up + Attack to use" ,
12
+ "active" : "Shift to activate, either toggled or held" ,
13
+ "augment" : "Passive effect on character" ,
14
+ "enchant" : "Passive effect on equipment" ,
15
+ "extension" : "Passive upgrade on other souls" ,
16
+ "catalyst" : "Used for soul forging" ,
17
+ "ability" : "Active special abilities" ,
18
+ "mastery" : "Powerful permanent abilities" ,
19
+ "identity" : "Determines the very essence"
20
+ }
21
+
10
22
var inventory_mode = false
11
23
var souls = []
12
24
var soul_stacks = {}
@@ -50,6 +62,10 @@ func on_press_key(key):
50
62
if inventory_select != old_select :
51
63
select_inventory ()
52
64
65
+ if key == Controls .ACCEPT :
66
+ equip_soul ()
67
+ slot_mode ()
68
+
53
69
if key == Controls .CANCEL :
54
70
slot_mode ()
55
71
@@ -69,21 +85,18 @@ func select():
69
85
select_rect .rect_size = selected .rect_size
70
86
select_rect .rect_position = selected .get_global_rect ().position - main .get_global_rect ().position
71
87
72
- if false and selected .soul_name :
73
- description .visible = true
74
- description .get_node ("Panel2/Text" ).text = Res .souls [selected .soul_name ].description
75
- description .get_node ("Panel1/Icon" ).modulate = slots .get_child (select ).color
76
- else :
77
- description .visible = false
88
+ description .visible = true
89
+ description .get_node ("Panel2/Text" ).text = SOUL_DESCRIPTIONS [Soul .TYPE_COLOR .keys ()[select ]]
90
+ description .get_node ("Panel1/Icon" ).modulate = slots .get_child (select ).color
78
91
79
92
func select_inventory ():
80
93
var selected = inventory .get_child (inventory_select )
81
94
select_rect .rect_size = selected .rect_size
82
95
select_rect .rect_position = selected .get_global_rect ().position - main .get_global_rect ().position
83
96
84
- if selected .soul_name :
97
+ if ! selected .empty () :
85
98
description .visible = true
86
- description .get_node ("Panel2/Text" ).text = Res .souls [selected .soul_name ].description
99
+ description .get_node ("Panel2/Text" ).text = Res .souls [selected .stack . soul ].description
87
100
description .get_node ("Panel1/Icon" ).modulate = slots .get_child (select ).color
88
101
else :
89
102
description .visible = false
@@ -129,4 +142,21 @@ func update_inventory():
129
142
else :
130
143
inventory .get_child (i ).clear_soul ()
131
144
132
- select_inventory ()
145
+ select_inventory ()
146
+
147
+ func update_equipment (souls ):
148
+ for i in 8 :
149
+ if souls [i ] > 0 :
150
+ slots .get_child (i ).set_soul (Res .get_res (Res .souls , souls [i ]).name )
151
+ else :
152
+ slots .get_child (i ).clear_soul ()
153
+
154
+ select ()
155
+
156
+ func equip_soul ():
157
+ var selected = inventory .get_child (inventory_select )
158
+
159
+ if ! selected .empty ():
160
+ Packet .new (Packet .TYPE .EQUIP_SOUL ).add_u8 (select ).add_u8 (selected .stack .origin ).send ()
161
+ inventory_select = - 1
162
+ select ()
0 commit comments