about summary refs log tree commit diff stats
path: root/Archipelago
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 /Archipelago
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.
Diffstat (limited to 'Archipelago')
-rw-r--r--Archipelago/client.gd26
-rw-r--r--Archipelago/settings_screen.gd1
-rw-r--r--Archipelago/teleport.gd24
3 files changed, 51 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