diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-02 13:18:33 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-02 13:18:33 -0500 |
commit | c45ca7725a9d77f29e8675182c3aff7b661b5c40 (patch) | |
tree | 80c4739a1912511586d409e7828bb12d1a952159 | |
parent | 4d2da5afe6a3ffad50ca5560c1dcceaddde2b9b0 (diff) | |
download | lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.tar.gz lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.tar.bz2 lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.zip |
Added sunwarp shuffling
-rw-r--r-- | Archipelago/client.gd | 6 | ||||
-rw-r--r-- | Archipelago/load.gd | 64 | ||||
-rw-r--r-- | util/generate_gamedata.rb | 17 |
3 files changed, 86 insertions, 1 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 964c642..b3668d7 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -136,6 +136,8 @@ var _early_color_hallways = false | |||
136 | var _pilgrimage_enabled = false | 136 | var _pilgrimage_enabled = false |
137 | var _pilgrimage_allows_roof_access = false | 137 | var _pilgrimage_allows_roof_access = false |
138 | var _pilgrimage_allows_paintings = false | 138 | var _pilgrimage_allows_paintings = false |
139 | var _sunwarp_shuffle = false | ||
140 | var _sunwarp_mapping = [] | ||
139 | var _slot_seed = 0 | 141 | var _slot_seed = 0 |
140 | 142 | ||
141 | var _map_loaded = false | 143 | var _map_loaded = false |
@@ -322,6 +324,10 @@ func _on_data(): | |||
322 | _pilgrimage_allows_roof_access = _slot_data["pilgrimage_allows_roof_access"] | 324 | _pilgrimage_allows_roof_access = _slot_data["pilgrimage_allows_roof_access"] |
323 | if _slot_data.has("pilgrimage_allows_paintings"): | 325 | if _slot_data.has("pilgrimage_allows_paintings"): |
324 | _pilgrimage_allows_paintings = _slot_data["pilgrimage_allows_paintings"] | 326 | _pilgrimage_allows_paintings = _slot_data["pilgrimage_allows_paintings"] |
327 | if _slot_data.has("shuffle_sunwarps"): | ||
328 | _sunwarp_shuffle = _slot_data["shuffle_sunwarps"] | ||
329 | if _slot_data.has("sunwarp_permutation"): | ||
330 | _sunwarp_mapping = _slot_data["sunwarp_permutation"] | ||
325 | 331 | ||
326 | _puzzle_skips = 0 | 332 | _puzzle_skips = 0 |
327 | 333 | ||
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index bca0742..0750247 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -566,6 +566,58 @@ func _load(): | |||
566 | 566 | ||
567 | terminator.add_child(terminator_shape) | 567 | terminator.add_child(terminator_shape) |
568 | get_node("Decorations").add_child(terminator) | 568 | get_node("Decorations").add_child(terminator) |
569 | |||
570 | if apclient._sunwarp_shuffle: | ||
571 | # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. | ||
572 | get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 | ||
573 | get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 | ||
574 | get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 | ||
575 | get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 | ||
576 | get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 | ||
577 | |||
578 | get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 | ||
579 | get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 | ||
580 | get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 | ||
581 | get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 | ||
582 | get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 | ||
583 | |||
584 | # Change the sunwarps in accordance with the mapping. | ||
585 | var sw_orig_translations = [] | ||
586 | var sw_text_translations = [] | ||
587 | var sw_text_rotations = [] | ||
588 | for i in range(1,7): | ||
589 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) | ||
590 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) | ||
591 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) | ||
592 | for i in range(1,7): | ||
593 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) | ||
594 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) | ||
595 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) | ||
596 | |||
597 | var sw_enter_indicators = [4, 5, 6, 12, 7, 10] | ||
598 | for i in range(1,7): | ||
599 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]] | ||
600 | get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]] | ||
601 | |||
602 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]] | ||
603 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]] | ||
604 | |||
605 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]] | ||
606 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]] | ||
607 | |||
608 | var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90 | ||
609 | var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90 | ||
610 | var final_rot = enter_rot - exit_rot | ||
611 | if final_rot < 0: | ||
612 | final_rot += 360 | ||
613 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) | ||
614 | |||
615 | var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"] | ||
616 | var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1]) | ||
617 | sw_enter_indicator.translation.x = sw_enter_indicator_pos[0] | ||
618 | sw_enter_indicator.translation.y = sw_enter_indicator_pos[1] | ||
619 | sw_enter_indicator.translation.z = sw_enter_indicator_pos[2] | ||
620 | sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180 | ||
569 | 621 | ||
570 | # Create the effects node. | 622 | # Create the effects node. |
571 | var effects_script = apclient.SCRIPT_effects | 623 | var effects_script = apclient.SCRIPT_effects |
@@ -666,3 +718,15 @@ func set_small_gridmap_tile(x, y, z, tile): | |||
666 | 718 | ||
667 | func archipelago_disconnected(reason): | 719 | func archipelago_disconnected(reason): |
668 | messages.showMessage(reason) | 720 | messages.showMessage(reason) |
721 | |||
722 | |||
723 | func _dir_to_int(dir): | ||
724 | if dir == "north": | ||
725 | return 0 | ||
726 | elif dir == "west": | ||
727 | return 1 | ||
728 | elif dir == "south": | ||
729 | return 2 | ||
730 | elif dir == "east": | ||
731 | return 3 | ||
732 | return 4 | ||
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 = {} | |||
19 | warp_ids_by_item_id = {} | 19 | warp_ids_by_item_id = {} |
20 | panel_ids_by_location_id = {} | 20 | panel_ids_by_location_id = {} |
21 | classification_by_location_id = {} | 21 | classification_by_location_id = {} |
22 | sunwarps = Array.new(12) {Hash.new} | ||
22 | mentioned_doors = Set[] | 23 | mentioned_doors = Set[] |
23 | mentioned_paintings = Set[] | 24 | mentioned_paintings = Set[] |
24 | mentioned_warps = Set[] | 25 | mentioned_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 | ||
94 | end | 105 | end |
95 | 106 | ||
96 | config.each do |room_name, room_data| | 107 | config.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 "]" | ||
242 | end | 257 | end |