diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/generate_gamedata.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index 1cce003..5e03655 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb | |||
@@ -15,12 +15,10 @@ door_groups = {} | |||
15 | panel_output = [] | 15 | panel_output = [] |
16 | door_ids_by_item_id = {} | 16 | door_ids_by_item_id = {} |
17 | painting_ids_by_item_id = {} | 17 | painting_ids_by_item_id = {} |
18 | warp_ids_by_item_id = {} | ||
19 | panel_ids_by_location_id = {} | 18 | panel_ids_by_location_id = {} |
20 | classification_by_location_id = {} | 19 | classification_by_location_id = {} |
21 | mentioned_doors = Set[] | 20 | mentioned_doors = Set[] |
22 | mentioned_paintings = Set[] | 21 | mentioned_paintings = Set[] |
23 | mentioned_warps = Set[] | ||
24 | painting_output = {} | 22 | painting_output = {} |
25 | 23 | ||
26 | ids_config = YAML.load_file(idspath) | 24 | ids_config = YAML.load_file(idspath) |
@@ -154,18 +152,6 @@ config.each do |room_name, room_data| | |||
154 | painting_ids_by_item_id[item_id] = internal_painting_ids | 152 | painting_ids_by_item_id[item_id] = internal_painting_ids |
155 | mentioned_paintings.merge(internal_painting_ids) | 153 | mentioned_paintings.merge(internal_painting_ids) |
156 | end | 154 | end |
157 | |||
158 | if door.include? "warp_id" | ||
159 | internal_warp_ids = [] | ||
160 | if door["warp_id"].kind_of? String | ||
161 | internal_warp_ids = [door["warp_id"]] | ||
162 | else | ||
163 | internal_warp_ids = door["warp_id"] | ||
164 | end | ||
165 | |||
166 | warp_ids_by_item_id[item_id] = internal_warp_ids | ||
167 | mentioned_warps.merge(internal_warp_ids) | ||
168 | end | ||
169 | end | 155 | end |
170 | end | 156 | end |
171 | end | 157 | end |
@@ -195,12 +181,6 @@ File.open(outputpath, "w") do |f| | |||
195 | "\"#{painting_id}\"" | 181 | "\"#{painting_id}\"" |
196 | end.join(",") + "]" | 182 | end.join(",") + "]" |
197 | end.join(",")) | 183 | end.join(",")) |
198 | f.write "}\nvar warp_ids_by_item_id = {" | ||
199 | f.write(warp_ids_by_item_id.map do |item_id, warp_ids| | ||
200 | "#{item_id}:[" + warp_ids.map do |warp_id| | ||
201 | "\"#{warp_id}\"" | ||
202 | end.join(",") + "]" | ||
203 | end.join(",")) | ||
204 | f.write "}\nvar panel_ids_by_location_id = {" | 184 | f.write "}\nvar panel_ids_by_location_id = {" |
205 | f.write(panel_ids_by_location_id.map do |location_id, panel_ids| | 185 | f.write(panel_ids_by_location_id.map do |location_id, panel_ids| |
206 | "#{location_id}:[" + panel_ids.map do |panel_id| | 186 | "#{location_id}:[" + panel_ids.map do |panel_id| |
@@ -215,10 +195,6 @@ File.open(outputpath, "w") do |f| | |||
215 | f.write(mentioned_paintings.map do |painting_id| | 195 | f.write(mentioned_paintings.map do |painting_id| |
216 | "\"#{painting_id}\"" | 196 | "\"#{painting_id}\"" |
217 | end.join(",")) | 197 | end.join(",")) |
218 | f.write "]\nvar mentioned_warps = [" | ||
219 | f.write(mentioned_warps.map do |warp_id| | ||
220 | "\"#{warp_id}\"" | ||
221 | end.join(",")) | ||
222 | f.write "]\nvar paintings = {" | 198 | f.write "]\nvar paintings = {" |
223 | f.write(painting_output.map do |painting_id, painting| | 199 | f.write(painting_output.map do |painting_id, painting| |
224 | "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}" | 200 | "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}" |