about summary refs log tree commit diff stats
path: root/util/generate_gamedata.rb
diff options
context:
space:
mode:
Diffstat (limited to 'util/generate_gamedata.rb')
-rw-r--r--util/generate_gamedata.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index 83099ad..7db06ca 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb
@@ -30,10 +30,25 @@ mentioned_warps = Set[]
30painting_output = {} 30painting_output = {}
31door_items_by_progressive_id = {} 31door_items_by_progressive_id = {}
32panel_items_by_progressive_id = {} 32panel_items_by_progressive_id = {}
33panel_location_ids = []
34solve_index_by_location = {}
33 35
34ids_config = YAML.load_file(idspath) 36ids_config = YAML.load_file(idspath)
35
36config = YAML.load_file(configpath) 37config = YAML.load_file(configpath)
38
39config.each do |room_name, room_data|
40 if room_data.include? "panels"
41 room_data["panels"].each do |panel_name, panel|
42 location_id = ids_config["panels"][room_name][panel_name]
43 panel_location_ids << location_id
44 end
45 end
46end
47
48panel_location_ids.sort.each_with_index do |location_id, index|
49 solve_index_by_location[location_id] = index
50end
51
37config.each do |room_name, room_data| 52config.each do |room_name, room_data|
38 if room_data.include? "panels" 53 if room_data.include? "panels"
39 room_data["panels"].each do |panel_name, panel| 54 room_data["panels"].each do |panel_name, panel|
@@ -45,6 +60,7 @@ config.each do |room_name, room_data|
45 ret = {} 60 ret = {}
46 ret["id"] = "\"#{panel["id"]}\"" 61 ret["id"] = "\"#{panel["id"]}\""
47 ret["loc"] = location_id 62 ret["loc"] = location_id
63 ret["solve_index"] = solve_index_by_location[location_id]
48 if panel.include? "colors" 64 if panel.include? "colors"
49 if panel["colors"].kind_of? String 65 if panel["colors"].kind_of? String
50 ret["color"] = "[\"#{panel["colors"]}\"]" 66 ret["color"] = "[\"#{panel["colors"]}\"]"
@@ -73,9 +89,6 @@ config.each do |room_name, room_data|
73 if panel.include? "achievement" 89 if panel.include? "achievement"
74 ret["achievement"] = "\"#{panel["achievement"]}\"" 90 ret["achievement"] = "\"#{panel["achievement"]}\""
75 end 91 end
76 if panel.include? "hunt" and panel["hunt"]
77 ret["hunt"] = "true"
78 end
79 panel_output << ret 92 panel_output << ret
80 93
81 panel_ids_by_location_id[location_id] = [panel["id"]] 94 panel_ids_by_location_id[location_id] = [panel["id"]]