From c45ca7725a9d77f29e8675182c3aff7b661b5c40 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 2 Mar 2024 13:18:33 -0500 Subject: Added sunwarp shuffling --- util/generate_gamedata.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'util/generate_gamedata.rb') 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 = {} warp_ids_by_item_id = {} panel_ids_by_location_id = {} classification_by_location_id = {} +sunwarps = Array.new(12) {Hash.new} mentioned_doors = Set[] mentioned_paintings = Set[] mentioned_warps = Set[] @@ -91,6 +92,16 @@ config.each do |room_name, room_data| painting_output[painting["id"]] = painting end end + + if room_data.include? "sunwarps" + room_data["sunwarps"].each do |sunwarp| + index = sunwarp["dots"] - 1 + if sunwarp["direction"] == "exit" then + index += 6 + end + sunwarps[index] = sunwarp + end + end end config.each do |room_name, room_data| @@ -238,5 +249,9 @@ File.open(outputpath, "w") do |f| f.write(classification_by_location_id.map do |location_id, classification| "#{location_id}:#{classification}" end.join(",")) - f.write "}" + f.write "}\nvar sunwarps = [" + f.write(sunwarps.map do |sunwarp| + "{\"orientation\":\"#{sunwarp["orientation"]}\",\"entrance_indicator_pos\":#{sunwarp["entrance_indicator_pos"].to_s}}" + end.join(",")) + f.write "]" end -- cgit 1.4.1