about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-04-18 17:42:35 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-04-18 17:42:35 -0400
commit139ecb09dcb49177d1fa39baaf8e378e3009fc76 (patch)
tree96aa935f8b1d88467269b00a9fadb5a9aadea278
parent6aad55fa66eb9caa668bb09289391e6b39eee7da (diff)
downloadlingo-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.gd26
-rw-r--r--Archipelago/settings_screen.gd1
-rw-r--r--Archipelago/teleport.gd24
-rw-r--r--util/generate_gamedata.rb24
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
82const kCLASSIFICATION_REMOTE_REDUCED = 1 91const kCLASSIFICATION_REMOTE_REDUCED = 1
83const kCLASSIFICATION_REMOTE_INSANITY = 2 92const kCLASSIFICATION_REMOTE_INSANITY = 2
84 93
94const kSUNWARP_ACCESS_NORMAL = 0
95const kSUNWARP_ACCESS_DISABLED = 1
96const kSUNWARP_ACCESS_UNLOCK = 2
97const kSUNWARP_ACCESS_PROGRESSIVE = 3
98
85var _client = WebSocketClient.new() 99var _client = WebSocketClient.new()
86var _should_process = false 100var _should_process = false
87var _initiated_disconnect = false 101var _initiated_disconnect = false
@@ -114,6 +128,7 @@ var _door_shuffle = false
114var _color_shuffle = false 128var _color_shuffle = false
115var _panel_shuffle = 0 # none, rearrange 129var _panel_shuffle = 0 # none, rearrange
116var _painting_shuffle = false 130var _painting_shuffle = false
131var _sunwarp_access = 0 # normal, disabled, unlock, progressive
117var _mastery_achievements = 21 132var _mastery_achievements = 21
118var _level_2_requirement = 223 133var _level_2_requirement = 223
119var _location_classification_bit = 0 134var _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
773func warpIsVanilla(warp):
774 return !$Gamedata.mentioned_warps.has(warp)
775
776
751func evaluateSolvability(): 777func 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 @@
1extends "res://scripts/teleport.gd"
2
3var _unlocked = true
4
5
6func _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
18func _body_entered(var body):
19 if _unlocked:
20 ._body_entered(body)
21
22
23func 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 = {}
15panel_output = [] 15panel_output = []
16door_ids_by_item_id = {} 16door_ids_by_item_id = {}
17painting_ids_by_item_id = {} 17painting_ids_by_item_id = {}
18warp_ids_by_item_id = {}
18panel_ids_by_location_id = {} 19panel_ids_by_location_id = {}
19classification_by_location_id = {} 20classification_by_location_id = {}
20mentioned_doors = Set[] 21mentioned_doors = Set[]
21mentioned_paintings = Set[] 22mentioned_paintings = Set[]
23mentioned_warps = Set[]
22painting_output = {} 24painting_output = {}
23 25
24ids_config = YAML.load_file(idspath) 26ids_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"]}}"