diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-04-18 17:42:35 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-04-18 17:42:35 -0400 |
commit | 139ecb09dcb49177d1fa39baaf8e378e3009fc76 (patch) | |
tree | 96aa935f8b1d88467269b00a9fadb5a9aadea278 | |
parent | 6aad55fa66eb9caa668bb09289391e6b39eee7da (diff) | |
download | lingo-archipelago-139ecb09dcb49177d1fa39baaf8e378e3009fc76.tar.gz lingo-archipelago-139ecb09dcb49177d1fa39baaf8e378e3009fc76.tar.bz2 lingo-archipelago-139ecb09dcb49177d1fa39baaf8e378e3009fc76.zip |
Reapply "Added support for warp items (including sunwarps)"
This reverts commit 17572f8cd5945536eccffbbe832517d75993c03f.
-rw-r--r-- | Archipelago/client.gd | 26 | ||||
-rw-r--r-- | Archipelago/settings_screen.gd | 1 | ||||
-rw-r--r-- | Archipelago/teleport.gd | 24 | ||||
-rw-r--r-- | util/generate_gamedata.rb | 24 |
4 files changed, 75 insertions, 0 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 8abc42c..d93b2ed 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -64,6 +64,15 @@ const progressive_items = { | |||
64 | {"item": "The Colorful - Green Door", "display": "Green"}, | 64 | {"item": "The Colorful - Green Door", "display": "Green"}, |
65 | {"item": "The Colorful - Brown Door", "display": "Brown"}, | 65 | {"item": "The Colorful - Brown Door", "display": "Brown"}, |
66 | {"item": "The Colorful - Gray Door", "display": "Gray"}, | 66 | {"item": "The Colorful - Gray Door", "display": "Gray"}, |
67 | ], | ||
68 | "Progressive Pilgrimage": | ||
69 | [ | ||
70 | {"item": "Hub Room - 1 Sunwarp", "display": "1 Sunwarp"}, | ||
71 | {"item": "Orange Tower Fourth Floor - 2 Sunwarp", "display": "2 Sunwarp"}, | ||
72 | {"item": "Orange Tower Third Floor - 3 Sunwarp", "display": "3 Sunwarp"}, | ||
73 | {"item": "Orange Tower First Floor - 4 Sunwarp", "display": "4 Sunwarp"}, | ||
74 | {"item": "Orange Tower Fourth Floor - 5 Sunwarp", "display": "5 Sunwarp"}, | ||
75 | {"item": "Outside The Agreeable - 6 Sunwarp", "display": "6 Sunwarp"}, | ||
67 | ] | 76 | ] |
68 | } | 77 | } |
69 | 78 | ||
@@ -82,6 +91,11 @@ const kCLASSIFICATION_REMOTE_NORMAL = 0 | |||
82 | const kCLASSIFICATION_REMOTE_REDUCED = 1 | 91 | const kCLASSIFICATION_REMOTE_REDUCED = 1 |
83 | const kCLASSIFICATION_REMOTE_INSANITY = 2 | 92 | const kCLASSIFICATION_REMOTE_INSANITY = 2 |
84 | 93 | ||
94 | const kSUNWARP_ACCESS_NORMAL = 0 | ||
95 | const kSUNWARP_ACCESS_DISABLED = 1 | ||
96 | const kSUNWARP_ACCESS_UNLOCK = 2 | ||
97 | const kSUNWARP_ACCESS_PROGRESSIVE = 3 | ||
98 | |||
85 | var _client = WebSocketClient.new() | 99 | var _client = WebSocketClient.new() |
86 | var _should_process = false | 100 | var _should_process = false |
87 | var _initiated_disconnect = false | 101 | var _initiated_disconnect = false |
@@ -114,6 +128,7 @@ var _door_shuffle = false | |||
114 | var _color_shuffle = false | 128 | var _color_shuffle = false |
115 | var _panel_shuffle = 0 # none, rearrange | 129 | var _panel_shuffle = 0 # none, rearrange |
116 | var _painting_shuffle = false | 130 | var _painting_shuffle = false |
131 | var _sunwarp_access = 0 # normal, disabled, unlock, progressive | ||
117 | var _mastery_achievements = 21 | 132 | var _mastery_achievements = 21 |
118 | var _level_2_requirement = 223 | 133 | var _level_2_requirement = 223 |
119 | var _location_classification_bit = 0 | 134 | var _location_classification_bit = 0 |
@@ -288,6 +303,8 @@ func _on_data(): | |||
288 | _painting_shuffle = _slot_data["shuffle_paintings"] | 303 | _painting_shuffle = _slot_data["shuffle_paintings"] |
289 | if _slot_data.has("shuffle_panels"): | 304 | if _slot_data.has("shuffle_panels"): |
290 | _panel_shuffle = _slot_data["shuffle_panels"] | 305 | _panel_shuffle = _slot_data["shuffle_panels"] |
306 | if _slot_data.has("sunwarp_access"): | ||
307 | _sunwarp_access = _slot_data["sunwarp_access"] | ||
291 | if _slot_data.has("seed"): | 308 | if _slot_data.has("seed"): |
292 | _slot_seed = _slot_data["seed"] | 309 | _slot_seed = _slot_data["seed"] |
293 | if _slot_data.has("painting_entrance_to_exit"): | 310 | if _slot_data.has("painting_entrance_to_exit"): |
@@ -687,6 +704,11 @@ func processItem(item, index, from, flags): | |||
687 | painting_node = fake_parent_node.get_node_or_null(painting_id) | 704 | painting_node = fake_parent_node.get_node_or_null(painting_id) |
688 | if painting_node != null: | 705 | if painting_node != null: |
689 | painting_node.get_node("Script").movePainting() | 706 | painting_node.get_node("Script").movePainting() |
707 | |||
708 | if gamedata.warp_ids_by_item_id.has(int(item)): | ||
709 | var warpsNode = get_tree().get_root().get_node("Spatial/Warps") | ||
710 | for warp_id in gamedata.warp_ids_by_item_id[int(item)]: | ||
711 | warpsNode.get_node(warp_id).unlock_warp() | ||
690 | 712 | ||
691 | # Handle progressive items. | 713 | # Handle progressive items. |
692 | if item_name in progressive_items.keys(): | 714 | if item_name in progressive_items.keys(): |
@@ -748,6 +770,10 @@ func paintingIsVanilla(painting): | |||
748 | return !$Gamedata.mentioned_paintings.has(painting) | 770 | return !$Gamedata.mentioned_paintings.has(painting) |
749 | 771 | ||
750 | 772 | ||
773 | func warpIsVanilla(warp): | ||
774 | return !$Gamedata.mentioned_warps.has(warp) | ||
775 | |||
776 | |||
751 | func evaluateSolvability(): | 777 | func evaluateSolvability(): |
752 | emit_signal("evaluate_solvability") | 778 | emit_signal("evaluate_solvability") |
753 | 779 | ||
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 453e3bf..dce9b70 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd | |||
@@ -52,6 +52,7 @@ func _ready(): | |||
52 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd")) | 52 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd")) |
53 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd")) | 53 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd")) |
54 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd")) | 54 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd")) |
55 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/teleport.gd")) | ||
55 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd")) | 56 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd")) |
56 | 57 | ||
57 | var apclient = global.get_node("Archipelago") | 58 | var apclient = global.get_node("Archipelago") |
diff --git a/Archipelago/teleport.gd b/Archipelago/teleport.gd new file mode 100644 index 0000000..d322722 --- /dev/null +++ b/Archipelago/teleport.gd | |||
@@ -0,0 +1,24 @@ | |||
1 | extends "res://scripts/teleport.gd" | ||
2 | |||
3 | var _unlocked = true | ||
4 | |||
5 | |||
6 | func _ready(): | ||
7 | var apclient = global.get_node("Archipelago") | ||
8 | if apclient._door_shuffle and !apclient.warpIsVanilla(self.get_parent().name + "/" + self.name): | ||
9 | if self.get_parent().name == "Teleporter Warps": | ||
10 | if apclient._sunwarp_access != apclient.kSUNWARP_ACCESS_NORMAL: | ||
11 | _unlocked = false | ||
12 | else: | ||
13 | _unlocked = false | ||
14 | |||
15 | ._ready() | ||
16 | |||
17 | |||
18 | func _body_entered(var body): | ||
19 | if _unlocked: | ||
20 | ._body_entered(body) | ||
21 | |||
22 | |||
23 | func unlock_warp(): | ||
24 | _unlocked = true | ||
diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index f63e062..8275ab7 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb | |||
@@ -15,10 +15,12 @@ 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 = {} | ||
18 | panel_ids_by_location_id = {} | 19 | panel_ids_by_location_id = {} |
19 | classification_by_location_id = {} | 20 | classification_by_location_id = {} |
20 | mentioned_doors = Set[] | 21 | mentioned_doors = Set[] |
21 | mentioned_paintings = Set[] | 22 | mentioned_paintings = Set[] |
23 | mentioned_warps = Set[] | ||
22 | painting_output = {} | 24 | painting_output = {} |
23 | 25 | ||
24 | ids_config = YAML.load_file(idspath) | 26 | ids_config = YAML.load_file(idspath) |
@@ -152,6 +154,18 @@ config.each do |room_name, room_data| | |||
152 | painting_ids_by_item_id[item_id] = internal_painting_ids | 154 | painting_ids_by_item_id[item_id] = internal_painting_ids |
153 | mentioned_paintings.merge(internal_painting_ids) | 155 | mentioned_paintings.merge(internal_painting_ids) |
154 | end | 156 | 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 | ||
155 | end | 169 | end |
156 | end | 170 | end |
157 | end | 171 | end |
@@ -181,6 +195,12 @@ File.open(outputpath, "w") do |f| | |||
181 | "\"#{painting_id}\"" | 195 | "\"#{painting_id}\"" |
182 | end.join(",") + "]" | 196 | end.join(",") + "]" |
183 | end.join(",")) | 197 | 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(",")) | ||
184 | f.write "}\nvar panel_ids_by_location_id = {" | 204 | f.write "}\nvar panel_ids_by_location_id = {" |
185 | f.write(panel_ids_by_location_id.map do |location_id, panel_ids| | 205 | f.write(panel_ids_by_location_id.map do |location_id, panel_ids| |
186 | "#{location_id}:[" + panel_ids.map do |panel_id| | 206 | "#{location_id}:[" + panel_ids.map do |panel_id| |
@@ -195,6 +215,10 @@ File.open(outputpath, "w") do |f| | |||
195 | f.write(mentioned_paintings.map do |painting_id| | 215 | f.write(mentioned_paintings.map do |painting_id| |
196 | "\"#{painting_id}\"" | 216 | "\"#{painting_id}\"" |
197 | end.join(",")) | 217 | end.join(",")) |
218 | f.write "]\nvar mentioned_warps = [" | ||
219 | f.write(mentioned_warps.map do |warp_id| | ||
220 | "\"#{warp_id}\"" | ||
221 | end.join(",")) | ||
198 | f.write "]\nvar paintings = {" | 222 | f.write "]\nvar paintings = {" |
199 | f.write(painting_output.map do |painting_id, painting| | 223 | f.write(painting_output.map do |painting_id, painting| |
200 | "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}" | 224 | "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}" |