about summary refs log tree commit diff stats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/generate_gamedata.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index 1cce003..4c530f1 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb
@@ -11,6 +11,7 @@ CLASSIFICATION_INSANITY = 4
11 11
12panel_to_id = {} 12panel_to_id = {}
13door_groups = {} 13door_groups = {}
14warp_groups = {}
14 15
15panel_output = [] 16panel_output = []
16door_ids_by_item_id = {} 17door_ids_by_item_id = {}
@@ -163,6 +164,11 @@ config.each do |room_name, room_data|
163 internal_warp_ids = door["warp_id"] 164 internal_warp_ids = door["warp_id"]
164 end 165 end
165 166
167 if door.include? "group"
168 warp_groups[door["group"]] ||= Set[]
169 warp_groups[door["group"]].merge(internal_warp_ids)
170 end
171
166 warp_ids_by_item_id[item_id] = internal_warp_ids 172 warp_ids_by_item_id[item_id] = internal_warp_ids
167 mentioned_warps.merge(internal_warp_ids) 173 mentioned_warps.merge(internal_warp_ids)
168 end 174 end
@@ -176,6 +182,11 @@ door_groups.each do |group_name, door_ids|
176 door_ids_by_item_id[item_id] = door_ids.to_a 182 door_ids_by_item_id[item_id] = door_ids.to_a
177end 183end
178 184
185warp_groups.each do |group_name, warp_ids|
186 item_id = ids_config["door_groups"][group_name]
187 warp_ids_by_item_id[item_id] = warp_ids.to_a
188end
189
179File.open(outputpath, "w") do |f| 190File.open(outputpath, "w") do |f|
180 f.write "extends Node\n\nvar panels = [" 191 f.write "extends Node\n\nvar panels = ["
181 f.write(panel_output.map do |panel| 192 f.write(panel_output.map do |panel|