about summary refs log tree commit diff stats
path: root/util
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-03-02 13:18:33 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-03-02 13:18:33 -0500
commitc45ca7725a9d77f29e8675182c3aff7b661b5c40 (patch)
tree80c4739a1912511586d409e7828bb12d1a952159 /util
parent4d2da5afe6a3ffad50ca5560c1dcceaddde2b9b0 (diff)
downloadlingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.tar.gz
lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.tar.bz2
lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.zip
Added sunwarp shuffling
Diffstat (limited to 'util')
-rw-r--r--util/generate_gamedata.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index 4c530f1..7674277 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb
@@ -19,6 +19,7 @@ painting_ids_by_item_id = {}
19warp_ids_by_item_id = {} 19warp_ids_by_item_id = {}
20panel_ids_by_location_id = {} 20panel_ids_by_location_id = {}
21classification_by_location_id = {} 21classification_by_location_id = {}
22sunwarps = Array.new(12) {Hash.new}
22mentioned_doors = Set[] 23mentioned_doors = Set[]
23mentioned_paintings = Set[] 24mentioned_paintings = Set[]
24mentioned_warps = Set[] 25mentioned_warps = Set[]
@@ -91,6 +92,16 @@ config.each do |room_name, room_data|
91 painting_output[painting["id"]] = painting 92 painting_output[painting["id"]] = painting
92 end 93 end
93 end 94 end
95
96 if room_data.include? "sunwarps"
97 room_data["sunwarps"].each do |sunwarp|
98 index = sunwarp["dots"] - 1
99 if sunwarp["direction"] == "exit" then
100 index += 6
101 end
102 sunwarps[index] = sunwarp
103 end
104 end
94end 105end
95 106
96config.each do |room_name, room_data| 107config.each do |room_name, room_data|
@@ -238,5 +249,9 @@ File.open(outputpath, "w") do |f|
238 f.write(classification_by_location_id.map do |location_id, classification| 249 f.write(classification_by_location_id.map do |location_id, classification|
239 "#{location_id}:#{classification}" 250 "#{location_id}:#{classification}"
240 end.join(",")) 251 end.join(","))
241 f.write "}" 252 f.write "}\nvar sunwarps = ["
253 f.write(sunwarps.map do |sunwarp|
254 "{\"orientation\":\"#{sunwarp["orientation"]}\",\"entrance_indicator_pos\":#{sunwarp["entrance_indicator_pos"].to_s}}"
255 end.join(","))
256 f.write "]"
242end 257end