about summary refs log tree commit diff stats
path: root/Archipelago
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-04-27 12:13:38 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-04-27 12:13:38 -0400
commit47755e9e28f9b8866d3c41866910594e2d8c979a (patch)
tree488df5471f58eb0c6a1f7f872a17aa0ebe07231e /Archipelago
parent4302e550cde189d8bc1d111e81270ed7960ad77c (diff)
parent0c25dc87e5ad9c8c8c2ff0ef5ac6502b166bc405 (diff)
downloadlingo-archipelago-47755e9e28f9b8866d3c41866910594e2d8c979a.tar.gz
lingo-archipelago-47755e9e28f9b8866d3c41866910594e2d8c979a.tar.bz2
lingo-archipelago-47755e9e28f9b8866d3c41866910594e2d8c979a.zip
Merge branch 'main' into panels
Diffstat (limited to 'Archipelago')
-rw-r--r--Archipelago/client.gd153
-rw-r--r--Archipelago/load.gd110
-rw-r--r--Archipelago/mypainting.gd5
-rw-r--r--Archipelago/painting.gd10
-rw-r--r--Archipelago/painting_eye.gd16
-rw-r--r--Archipelago/painting_scenery.gd10
-rw-r--r--Archipelago/panel.gd2
-rw-r--r--Archipelago/pilgrimage_terminator.gd11
-rw-r--r--Archipelago/settings_screen.gd35
-rw-r--r--Archipelago/teleport.gd27
10 files changed, 301 insertions, 78 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 6fe2cab..0944352 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -7,6 +7,7 @@ var SCRIPT_multiplayer
7var SCRIPT_mypainting 7var SCRIPT_mypainting
8var SCRIPT_notifier 8var SCRIPT_notifier
9var SCRIPT_panel 9var SCRIPT_panel
10var SCRIPT_pilgrimage_terminator
10var SCRIPT_uuid 11var SCRIPT_uuid
11 12
12var ap_server = "" 13var ap_server = ""
@@ -15,55 +16,24 @@ var ap_pass = ""
15var confusify_world = false 16var confusify_world = false
16var enable_multiplayer = false 17var enable_multiplayer = false
17var track_player = false 18var track_player = false
19var connection_history = []
18 20
19const my_version = "2.1.1" 21const my_version = "3.0.1"
20const ap_version = {"major": 0, "minor": 4, "build": 5, "class": "Version"} 22const ap_version = {"major": 0, "minor": 4, "build": 6, "class": "Version"}
21const color_items = [ 23const color_items = [
22 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" 24 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow"
23] 25]
24const door_progressive_items = { 26const door_progressive_items = {
25 "Progressive Orange Tower": 27 "Progressive Orange Tower":
26 [ 28 ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"],
27 {"item": "Orange Tower - Second Floor", "display": "Second Floor"},
28 {"item": "Orange Tower - Third Floor", "display": "Third Floor"},
29 {"item": "Orange Tower - Fourth Floor", "display": "Fourth Floor"},
30 {"item": "Orange Tower - Fifth Floor", "display": "Fifth Floor"},
31 {"item": "Orange Tower - Sixth Floor", "display": "Sixth Floor"},
32 {"item": "Orange Tower - Seventh Floor", "display": "Seventh Floor"},
33 ],
34 "Progressive Art Gallery": 29 "Progressive Art Gallery":
35 [ 30 ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Exit"],
36 {"item": "Art Gallery - Second Floor", "display": "Second Floor"}, 31 "Progressive Hallway Room": ["First Door", "Second Door", "Third Door", "Fourth Door"],
37 {"item": "Art Gallery - Third Floor", "display": "Third Floor"}, 32 "Progressive Fearless": ["Second Floor", "Third Floor"],
38 {"item": "Art Gallery - Fourth Floor", "display": "Fourth Floor"},
39 {"item": "Art Gallery - Fifth Floor", "display": "Fifth Floor"},
40 {"item": "Art Gallery - Exit", "display": "Exit"},
41 ],
42 "Progressive Hallway Room":
43 [
44 {"item": "Outside The Agreeable - Hallway Door", "display": "First Door"},
45 {"item": "Hallway Room (2) - Exit", "display": "Second Door"},
46 {"item": "Hallway Room (3) - Exit", "display": "Third Door"},
47 {"item": "Hallway Room (4) - Exit", "display": "Fourth Door"},
48 ],
49 "Progressive Fearless":
50 [
51 {"item": "The Fearless (First Floor) - Second Floor", "display": "Second Floor"},
52 {"item": "The Fearless (Second Floor) - Third Floor", "display": "Third Floor"},
53 ],
54 "Progressive Colorful": 33 "Progressive Colorful":
55 [ 34 ["White", "Black", "Red", "Yellow", "Blue", "Purple", "Orange", "Green", "Brown", "Gray"],
56 {"item": "The Colorful - White Door", "display": "White"}, 35 "Progressive Pilgrimage":
57 {"item": "The Colorful - Black Door", "display": "Black"}, 36 ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"]
58 {"item": "The Colorful - Red Door", "display": "Red"},
59 {"item": "The Colorful - Yellow Door", "display": "Yellow"},
60 {"item": "The Colorful - Blue Door", "display": "Blue"},
61 {"item": "The Colorful - Purple Door", "display": "Purple"},
62 {"item": "The Colorful - Orange Door", "display": "Orange"},
63 {"item": "The Colorful - Green Door", "display": "Green"},
64 {"item": "The Colorful - Brown Door", "display": "Brown"},
65 {"item": "The Colorful - Gray Door", "display": "Gray"},
66 ]
67} 37}
68const panel_progressive_items = { 38const panel_progressive_items = {
69 "Progressive Hallway Room": 39 "Progressive Hallway Room":
@@ -103,6 +73,7 @@ const panel_progressive_items = {
103const kTHE_END = 0 73const kTHE_END = 0
104const kTHE_MASTER = 1 74const kTHE_MASTER = 1
105const kLEVEL_2 = 2 75const kLEVEL_2 = 2
76const kPILGRIMAGE = 3
106 77
107const kNO_PANEL_SHUFFLE = 0 78const kNO_PANEL_SHUFFLE = 0
108const kREARRANGE_PANELS = 1 79const kREARRANGE_PANELS = 1
@@ -115,6 +86,12 @@ const kCLASSIFICATION_REMOTE_NORMAL = 0
115const kCLASSIFICATION_REMOTE_REDUCED = 1 86const kCLASSIFICATION_REMOTE_REDUCED = 1
116const kCLASSIFICATION_REMOTE_INSANITY = 2 87const kCLASSIFICATION_REMOTE_INSANITY = 2
117 88
89const kSUNWARP_ACCESS_NORMAL = 0
90const kSUNWARP_ACCESS_DISABLED = 1
91const kSUNWARP_ACCESS_UNLOCK = 2
92const kSUNWARP_ACCESS_INDIVIDUAL = 3
93const kSUNWARP_ACCESS_PROGRESSIVE = 4
94
118var _client = WebSocketClient.new() 95var _client = WebSocketClient.new()
119var _should_process = false 96var _should_process = false
120var _initiated_disconnect = false 97var _initiated_disconnect = false
@@ -148,10 +125,17 @@ var _panel_door_shuffle = false
148var _color_shuffle = false 125var _color_shuffle = false
149var _panel_shuffle = 0 # none, rearrange 126var _panel_shuffle = 0 # none, rearrange
150var _painting_shuffle = false 127var _painting_shuffle = false
128var _sunwarp_access = 0 # normal, disabled, unlock, progressive
151var _mastery_achievements = 21 129var _mastery_achievements = 21
152var _level_2_requirement = 223 130var _level_2_requirement = 223
153var _location_classification_bit = 0 131var _location_classification_bit = 0
154var _early_color_hallways = false 132var _early_color_hallways = false
133var _pilgrimage_compatibility = false # set to true for pre-0.4.6
134var _pilgrimage_enabled = false
135var _pilgrimage_allows_roof_access = false
136var _pilgrimage_allows_paintings = false
137var _sunwarp_shuffle = false
138var _sunwarp_mapping = []
155var _slot_seed = 0 139var _slot_seed = 0
156 140
157var _map_loaded = false 141var _map_loaded = false
@@ -197,6 +181,8 @@ func _init():
197 enable_multiplayer = data[5] 181 enable_multiplayer = data[5]
198 if data.size() > 6: 182 if data.size() > 6:
199 track_player = data[6] 183 track_player = data[6]
184 if data.size() > 7:
185 connection_history = data[7]
200 186
201 processDatapackages() 187 processDatapackages()
202 188
@@ -325,6 +311,10 @@ func _on_data():
325 _painting_shuffle = _slot_data["shuffle_paintings"] 311 _painting_shuffle = _slot_data["shuffle_paintings"]
326 if _slot_data.has("shuffle_panels"): 312 if _slot_data.has("shuffle_panels"):
327 _panel_shuffle = _slot_data["shuffle_panels"] 313 _panel_shuffle = _slot_data["shuffle_panels"]
314 if _slot_data.has("sunwarp_access"):
315 _sunwarp_access = _slot_data["sunwarp_access"]
316 else:
317 _sunwarp_access = kSUNWARP_ACCESS_NORMAL
328 if _slot_data.has("seed"): 318 if _slot_data.has("seed"):
329 _slot_seed = _slot_data["seed"] 319 _slot_seed = _slot_data["seed"]
330 if _slot_data.has("painting_entrance_to_exit"): 320 if _slot_data.has("painting_entrance_to_exit"):
@@ -342,6 +332,25 @@ func _on_data():
342 _location_classification_bit = kCLASSIFICATION_LOCAL_INSANITY 332 _location_classification_bit = kCLASSIFICATION_LOCAL_INSANITY
343 if _slot_data.has("early_color_hallways"): 333 if _slot_data.has("early_color_hallways"):
344 _early_color_hallways = _slot_data["early_color_hallways"] 334 _early_color_hallways = _slot_data["early_color_hallways"]
335 if _slot_data.has("enable_pilgrimage"):
336 _pilgrimage_enabled = _slot_data["enable_pilgrimage"]
337 else:
338 _pilgrimage_compatibility = true
339 _pilgrimage_enabled = true
340 if _slot_data.has("pilgrimage_allows_roof_access"):
341 _pilgrimage_allows_roof_access = _slot_data["pilgrimage_allows_roof_access"]
342 else:
343 _pilgrimage_allows_roof_access = true
344 if _slot_data.has("pilgrimage_allows_paintings"):
345 _pilgrimage_allows_paintings = _slot_data["pilgrimage_allows_paintings"]
346 else:
347 _pilgrimage_allows_paintings = true
348 if _slot_data.has("shuffle_sunwarps"):
349 _sunwarp_shuffle = _slot_data["shuffle_sunwarps"]
350 else:
351 _sunwarp_shuffle = false
352 if _slot_data.has("sunwarp_permutation"):
353 _sunwarp_mapping = _slot_data["sunwarp_permutation"]
345 354
346 if track_player: 355 if track_player:
347 setValue("PlayerPos", {"x": 0, "z": 0}) 356 setValue("PlayerPos", {"x": 0, "z": 0})
@@ -527,7 +536,8 @@ func saveSettings():
527 _datapackages, 536 _datapackages,
528 confusify_world, 537 confusify_world,
529 enable_multiplayer, 538 enable_multiplayer,
530 track_player 539 track_player,
540 connection_history
531 ] 541 ]
532 file.store_var(data, true) 542 file.store_var(data, true)
533 file.close() 543 file.close()
@@ -730,26 +740,35 @@ func processItem(item, index, from, flags):
730 if painting_node != null: 740 if painting_node != null:
731 painting_node.get_node("Script").movePainting() 741 painting_node.get_node("Script").movePainting()
732 742
743 if gamedata.warp_ids_by_item_id.has(int(item)):
744 var warpsNode = get_tree().get_root().get_node("Spatial/Warps")
745 for warp_id in gamedata.warp_ids_by_item_id[int(item)]:
746 warpsNode.get_node(warp_id).unlock_warp()
747
733 # Handle progressive items. 748 # Handle progressive items.
734 if _door_shuffle and item_name in door_progressive_items.keys(): 749 var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id
735 if not item_name in _progressive_progress: 750 var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id
736 _progressive_progress[item_name] = 0 751 var progitems = null
737 752
738 if _progressive_progress[item_name] < door_progressive_items[item_name].size(): 753 if is_progressive_door and is_progressive_panel:
739 var subitem_name = door_progressive_items[item_name][_progressive_progress[item_name]]["item"] 754 if _door_shuffle:
740 global._print(subitem_name) 755 progitems = gamedata.door_items_by_progressive_id[int(item)]
741 processItem(_item_name_to_id[subitem_name], null, null, null) 756 else:
742 _progressive_progress[item_name] += 1 757 progitems = gamedata.panel_items_by_progressive_id[int(item)]
743 758 elif is_progressive_door:
744 if _panel_door_shuffle and item_name in panel_progressive_items.keys(): 759 progitems = gamedata.door_items_by_progressive_id[int(item)]
745 if not item_name in _progressive_progress: 760 elif is_progressive_panel:
746 _progressive_progress[item_name] = 0 761 progitems = gamedata.panel_items_by_progressive_id[int(item)]
747 762
748 if _progressive_progress[item_name] < panel_progressive_items[item_name].size(): 763 if progitems != null:
749 var subitem_name = panel_progressive_items[item_name][_progressive_progress[item_name]]["item"] 764 if not int(item) in _progressive_progress:
750 global._print(subitem_name) 765 _progressive_progress[int(item)] = 0
751 processItem(_item_name_to_id[subitem_name], null, null, null) 766
752 _progressive_progress[item_name] += 1 767 if _progressive_progress[int(item)] < progitems.size():
768 var subitem_id = progitems[_progressive_progress[int(item)]]
769 global._print("Subitem: %d" % subitem_id)
770 processItem(subitem_id, null, null, null)
771 _progressive_progress[int(item)] += 1
753 772
754 if _color_shuffle and color_items.has(_item_id_to_name[item]): 773 if _color_shuffle and color_items.has(_item_id_to_name[item]):
755 var lcol = _item_id_to_name[item].to_lower() 774 var lcol = _item_id_to_name[item].to_lower()
@@ -763,11 +782,11 @@ func processItem(item, index, from, flags):
763 saveLocaldata() 782 saveLocaldata()
764 783
765 if _door_shuffle and item_name in door_progressive_items: 784 if _door_shuffle and item_name in door_progressive_items:
766 var subitem = door_progressive_items[item_name][_progressive_progress[item_name] - 1] 785 var subitem = door_progressive_items[item_name][_progressive_progress[int(item)] - 1]
767 item_name += " (%s)" % subitem["display"] 786 item_name += " (%s)" % subitem["display"]
768 787
769 if _panel_door_shuffle and item_name in panel_progressive_items: 788 if _panel_door_shuffle and item_name in panel_progressive_items:
770 var subitem = panel_progressive_items[item_name][_progressive_progress[item_name] - 1] 789 var subitem = panel_progressive_items[item_name][_progressive_progress[int(item)] - 1]
771 item_name += " (%s)" % subitem["display"] 790 item_name += " (%s)" % subitem["display"]
772 791
773 var player_name = "Unknown" 792 var player_name = "Unknown"
@@ -804,6 +823,10 @@ func paintingIsVanilla(painting):
804 return !$Gamedata.mentioned_paintings.has(painting) 823 return !$Gamedata.mentioned_paintings.has(painting)
805 824
806 825
826func warpIsVanilla(warp):
827 return !$Gamedata.mentioned_warps.has(warp)
828
829
807func evaluateSolvability(): 830func evaluateSolvability():
808 emit_signal("evaluate_solvability") 831 emit_signal("evaluate_solvability")
809 832
@@ -849,5 +872,5 @@ func compareVersion(lhs, rhs):
849 return lhs["major"] < rhs["major"] 872 return lhs["major"] < rhs["major"]
850 873
851 874
852func wasGeneratedBeforeVersion(rhs): 875func wasGeneratedBeforeVersion(major, minor, build):
853 return compareVersion(_gen_version, rhs) 876 return compareVersion(_gen_version, {"major": major, "minor": minor, "build": build})
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 82f8e94..6ce4749 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd
@@ -96,18 +96,19 @@ func _load():
96 96
97 wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map 97 wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map
98 98
99 # Turn THE COLORFUL into a cdp.
100 var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful")
101 var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") 99 var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn")
102 var colorful_cdp = cdp_auto_scene.instance() 100 if !apclient.wasGeneratedBeforeVersion(0, 4, 5):
103 colorful_cdp.name = "CountdownPanel_colorful" 101 # Turn THE COLORFUL into a cdp.
104 colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" 102 var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful")
105 colorful_cdp.panels = "../../Panels/Doorways Room" 103 var colorful_cdp = cdp_auto_scene.instance()
106 colorful_cdp.translation = real_colorful.translation 104 colorful_cdp.name = "CountdownPanel_colorful"
107 colorful_cdp.rotation = real_colorful.rotation 105 colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful"
108 get_node("CountdownPanels").add_child(colorful_cdp) 106 colorful_cdp.panels = "../../Panels/Doorways Room"
109 real_colorful.translation = Vector3(-51, -35, 35) # way under the map 107 colorful_cdp.translation = real_colorful.translation
110 get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() 108 colorful_cdp.rotation = real_colorful.rotation
109 get_node("CountdownPanels").add_child(colorful_cdp)
110 real_colorful.translation = Vector3(-51, -35, 35) # way under the map
111 get_node("Doors/Doorway Room Doors/Door_gray2").queue_free()
111 112
112 # Set up The Master to be variable. 113 # Set up The Master to be variable.
113 var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") 114 var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16")
@@ -353,6 +354,8 @@ func _load():
353 victory_condition = "the master" 354 victory_condition = "the master"
354 elif apclient._victory_condition == apclient.kLEVEL_2: 355 elif apclient._victory_condition == apclient.kLEVEL_2:
355 victory_condition = "level 2" 356 victory_condition = "level 2"
357 elif apclient._victory_condition == apclient.kPILGRIMAGE:
358 victory_condition = "pilgrimage"
356 359
357 set_static_panel("Entry Room/Panel_this_this", victory_condition) 360 set_static_panel("Entry Room/Panel_this_this", victory_condition)
358 set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") 361 set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo")
@@ -584,11 +587,84 @@ func _load():
584 level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( 587 level_2.get_node("Viewport/GUI/Panel/TextEdit").connect(
585 "answer_correct", apclient, "completedGoal" 588 "answer_correct", apclient, "completedGoal"
586 ) 589 )
590 elif apclient._victory_condition == apclient.kPILGRIMAGE:
591 var pilgrim_panel = self.get_node("Panels/Lingo Room/Panel_pilgrim")
592 pilgrim_panel.get_node("Viewport/GUI/Panel/TextEdit").connect(
593 "answer_correct", apclient, "completedGoal"
594 )
587 else: 595 else:
588 var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") 596 var the_end = self.get_node("Decorations/EndPanel/Panel_end_end")
589 the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( 597 the_end.get_node("Viewport/GUI/Panel/TextEdit").connect(
590 "answer_correct", apclient, "completedGoal" 598 "answer_correct", apclient, "completedGoal"
591 ) 599 )
600
601 # If pilgrimage does not allow roof access, add a node on the Crossroads
602 # Roof Access stairs that disables it.
603 if !apclient._pilgrimage_allows_roof_access:
604 var terminator = apclient.SCRIPT_pilgrimage_terminator.new()
605 terminator.name = "RoofAccessPilgrimageTerminator"
606 terminator.translation.x = -36
607 terminator.translation.y = 3
608 terminator.translation.z = -35
609
610 var terminator_shape = CollisionShape.new()
611 terminator_shape.shape = BoxShape.new()
612 terminator_shape.shape.extents.x = 0.1
613
614 terminator.add_child(terminator_shape)
615 get_node("Decorations").add_child(terminator)
616
617 if apclient._sunwarp_shuffle:
618 # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that.
619 get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0
620 get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0
621 get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0
622 get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0
623 get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90
624
625 get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5
626 get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5
627 get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5
628 get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5
629 get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5
630
631 # Change the sunwarps in accordance with the mapping.
632 var sw_orig_translations = []
633 var sw_text_translations = []
634 var sw_text_rotations = []
635 for i in range(1,7):
636 sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation)
637 sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation)
638 sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees)
639 for i in range(1,7):
640 sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation)
641 sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation)
642 sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees)
643
644 var sw_enter_indicators = [4, 5, 6, 12, 7, 10]
645 for i in range(1,7):
646 get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]]
647 get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]]
648
649 get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]]
650 get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]]
651
652 get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]]
653 get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]]
654
655 var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90
656 var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90
657 var final_rot = enter_rot - exit_rot
658 if final_rot < 0:
659 final_rot += 360
660 get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot)
661
662 var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"]
663 var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1])
664 sw_enter_indicator.translation.x = sw_enter_indicator_pos[0]
665 sw_enter_indicator.translation.y = sw_enter_indicator_pos[1]
666 sw_enter_indicator.translation.z = sw_enter_indicator_pos[2]
667 sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180
592 668
593 # Create the effects node. 669 # Create the effects node.
594 var effects_script = apclient.SCRIPT_effects 670 var effects_script = apclient.SCRIPT_effects
@@ -719,3 +795,15 @@ func set_small_gridmap_tile(x, y, z, tile):
719 795
720func archipelago_disconnected(reason): 796func archipelago_disconnected(reason):
721 messages.showMessage(reason) 797 messages.showMessage(reason)
798
799
800func _dir_to_int(dir):
801 if dir == "north":
802 return 0
803 elif dir == "west":
804 return 1
805 elif dir == "south":
806 return 2
807 elif dir == "east":
808 return 3
809 return 4
diff --git a/Archipelago/mypainting.gd b/Archipelago/mypainting.gd index 5e9c703..999b122 100644 --- a/Archipelago/mypainting.gd +++ b/Archipelago/mypainting.gd
@@ -86,6 +86,11 @@ func _looked_at(body, painting):
86 body.rotate_y(3 * PI / 2) 86 body.rotate_y(3 * PI / 2)
87 body.velocity = body.velocity.rotated(Vector3(0, 1, 0), 3 * PI / 2) 87 body.velocity = body.velocity.rotated(Vector3(0, 1, 0), 3 * PI / 2)
88 88
89 var apclient = global.get_node("Archipelago")
90 if !apclient._pilgrimage_allows_paintings:
91 global.sunwarp = 1
92 body.get_node("pivot/camera/sunwarp_background").visible = false
93
89 94
90func _dir_to_int(dir): 95func _dir_to_int(dir):
91 if dir == "north": 96 if dir == "north":
diff --git a/Archipelago/painting.gd b/Archipelago/painting.gd new file mode 100644 index 0000000..adc8337 --- /dev/null +++ b/Archipelago/painting.gd
@@ -0,0 +1,10 @@
1extends "res://scripts/painting.gd"
2
3func _looked_at(var body, var painting):
4 ._looked_at(body, painting)
5
6 if body.is_in_group("player") && (painting.get_name() == self.get_name()):
7 var apclient = global.get_node("Archipelago")
8 if !apclient._pilgrimage_allows_paintings:
9 global.sunwarp = 1
10 body.get_node("pivot/camera/sunwarp_background").visible = false
diff --git a/Archipelago/painting_eye.gd b/Archipelago/painting_eye.gd index 53d42b5..b2e6973 100644 --- a/Archipelago/painting_eye.gd +++ b/Archipelago/painting_eye.gd
@@ -3,9 +3,23 @@ extends "res://scripts/painting_eye.gd"
3 3
4func _answer_correct(): 4func _answer_correct():
5 var apclient = global.get_node("Archipelago") 5 var apclient = global.get_node("Archipelago")
6 if not apclient._door_shuffle or apclient.paintingIsVanilla(self.name): 6 if !apclient._pilgrimage_compatibility and get_name() == "pilgrim_painting2":
7 # When pilgrimage is enabled, the HOT CRUST panel should actually move the sun painting.
8 if apclient._pilgrimage_enabled:
9 movePainting()
10 elif not apclient._door_shuffle or apclient.paintingIsVanilla(self.name):
7 ._answer_correct() 11 ._answer_correct()
8 12
9 13
10func movePainting(): 14func movePainting():
11 ._answer_correct() 15 ._answer_correct()
16
17
18func _looked_at(var body, var painting):
19 ._looked_at(body, painting)
20
21 if body.is_in_group("player") && (painting.get_name() == self.get_name()):
22 var apclient = global.get_node("Archipelago")
23 if !apclient._pilgrimage_allows_paintings:
24 global.sunwarp = 1
25 body.get_node("pivot/camera/sunwarp_background").visible = false
diff --git a/Archipelago/painting_scenery.gd b/Archipelago/painting_scenery.gd index f49d602..1186e2f 100644 --- a/Archipelago/painting_scenery.gd +++ b/Archipelago/painting_scenery.gd
@@ -9,3 +9,13 @@ func _answer_correct():
9 9
10func movePainting(): 10func movePainting():
11 ._answer_correct() 11 ._answer_correct()
12
13
14func _looked_at(var body, var painting):
15 ._looked_at(body, painting)
16
17 if body.is_in_group("player") && (painting.get_name() == self.get_name()):
18 var apclient = global.get_node("Archipelago")
19 if !apclient._pilgrimage_allows_paintings:
20 global.sunwarp = 1
21 body.get_node("pivot/camera/sunwarp_background").visible = false
diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index 0e8f1df..9d30455 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd
@@ -23,7 +23,7 @@ func _ready():
23 else: 23 else:
24 atbash_text += old_char 24 atbash_text += old_char
25 25
26 self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").connect( 26 var _ignore = self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").connect(
27 "answer_correct", self, "answer_correct" 27 "answer_correct", self, "answer_correct"
28 ) 28 )
29 29
diff --git a/Archipelago/pilgrimage_terminator.gd b/Archipelago/pilgrimage_terminator.gd new file mode 100644 index 0000000..29db2ee --- /dev/null +++ b/Archipelago/pilgrimage_terminator.gd
@@ -0,0 +1,11 @@
1extends Area
2
3
4func _ready():
5 var _connected = self.connect("body_entered", self, "_body_entered")
6
7
8func _body_entered(body):
9 if body.is_in_group("player"):
10 global.sunwarp = 1
11 body.get_node("pivot/camera/sunwarp_background").visible = false
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index de64214..79fdcc3 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd
@@ -30,6 +30,8 @@ func _ready():
30 apclient_instance.SCRIPT_mypainting = load("user://maps/Archipelago/mypainting.gd") 30 apclient_instance.SCRIPT_mypainting = load("user://maps/Archipelago/mypainting.gd")
31 apclient_instance.SCRIPT_notifier = load("user://maps/Archipelago/notifier.gd") 31 apclient_instance.SCRIPT_notifier = load("user://maps/Archipelago/notifier.gd")
32 apclient_instance.SCRIPT_panel = load("user://maps/Archipelago/panel.gd") 32 apclient_instance.SCRIPT_panel = load("user://maps/Archipelago/panel.gd")
33 var pilg_term = load("user://maps/Archipelago/pilgrimage_terminator.gd")
34 apclient_instance.SCRIPT_pilgrimage_terminator = pilg_term
33 apclient_instance.SCRIPT_uuid = load("user://maps/Archipelago/vendor/uuid.gd") 35 apclient_instance.SCRIPT_uuid = load("user://maps/Archipelago/vendor/uuid.gd")
34 36
35 var apdata = ResourceLoader.load("user://maps/Archipelago/gamedata.gd") 37 var apdata = ResourceLoader.load("user://maps/Archipelago/gamedata.gd")
@@ -45,6 +47,7 @@ func _ready():
45 # Let's also inject any scripts we need to inject now. 47 # Let's also inject any scripts we need to inject now.
46 installScriptExtension(apclient_instance.SCRIPT_doorControl) 48 installScriptExtension(apclient_instance.SCRIPT_doorControl)
47 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd")) 49 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd"))
50 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting.gd"))
48 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd")) 51 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd"))
49 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd")) 52 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd"))
50 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd")) 53 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd"))
@@ -52,6 +55,7 @@ func _ready():
52 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd")) 55 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd"))
53 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd")) 56 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd"))
54 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd")) 57 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd"))
58 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/teleport.gd"))
55 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd")) 59 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd"))
56 60
57 var apclient = global.get_node("Archipelago") 61 var apclient = global.get_node("Archipelago")
@@ -67,6 +71,19 @@ func _ready():
67 self.get_node("Panel/multiplayer_box").pressed = apclient.enable_multiplayer 71 self.get_node("Panel/multiplayer_box").pressed = apclient.enable_multiplayer
68 self.get_node("Panel/position_box").pressed = apclient.track_player 72 self.get_node("Panel/position_box").pressed = apclient.track_player
69 73
74 var history_box = get_node("Panel/connection_history")
75 if apclient.connection_history.empty():
76 history_box.disabled = true
77 else:
78 history_box.disabled = false
79
80 var i = 0
81 for details in apclient.connection_history:
82 history_box.get_popup().add_item("%s (%s)" % [details[1], details[0]], i)
83 i += 1
84
85 history_box.get_popup().connect("id_pressed", self, "historySelected")
86
70 # Show client version. 87 # Show client version.
71 self.get_node("Panel/title").text = "ARCHIPELAGO (%s)" % apclient.my_version 88 self.get_node("Panel/title").text = "ARCHIPELAGO (%s)" % apclient.my_version
72 89
@@ -109,6 +126,15 @@ func connectionStatus(message):
109func connectionSuccessful(): 126func connectionSuccessful():
110 var apclient = global.get_node("Archipelago") 127 var apclient = global.get_node("Archipelago")
111 128
129 # Save connection details
130 var connection_details = [apclient.ap_server, apclient.ap_user, apclient.ap_pass]
131 if apclient.connection_history.has(connection_details):
132 apclient.connection_history.erase(connection_details)
133 apclient.connection_history.push_front(connection_details)
134 if apclient.connection_history.size() > 10:
135 apclient.connection_history.resize(10)
136 apclient.saveSettings()
137
112 # Switch to LL1 138 # Switch to LL1
113 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 139 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
114 global.save_file = apclient.getSaveFileName() 140 global.save_file = apclient.getSaveFileName()
@@ -130,3 +156,12 @@ func connectionUnsuccessful(error_message):
130 popup.popup_exclusive = true 156 popup.popup_exclusive = true
131 popup.get_ok().visible = true 157 popup.get_ok().visible = true
132 popup.popup_centered() 158 popup.popup_centered()
159
160
161func historySelected(index):
162 var apclient = global.get_node("Archipelago")
163 var details = apclient.connection_history[index]
164
165 self.get_node("Panel/server_box").text = details[0]
166 self.get_node("Panel/player_box").text = details[1]
167 self.get_node("Panel/password_box").text = details[2]
diff --git a/Archipelago/teleport.gd b/Archipelago/teleport.gd new file mode 100644 index 0000000..532f081 --- /dev/null +++ b/Archipelago/teleport.gd
@@ -0,0 +1,27 @@
1extends "res://scripts/teleport.gd"
2
3var _unlocked = true
4
5
6func _ready():
7 var apclient = global.get_node("Archipelago")
8 if self.get_parent().name == "Teleporter Warps":
9 if apclient._sunwarp_access != apclient.kSUNWARP_ACCESS_NORMAL:
10 _unlocked = false
11 elif apclient._door_shuffle and !apclient.warpIsVanilla(self.get_parent().name + "/" + self.name):
12 _unlocked = false
13
14
15func _body_entered(body):
16 if _unlocked:
17 ._body_entered(body)
18
19 if body.is_in_group("player"):
20 var apclient = global.get_node("Archipelago")
21 if !apclient._pilgrimage_enabled:
22 global.sunwarp = 1
23 body.get_node("pivot/camera/sunwarp_background").visible = false
24
25
26func unlock_warp():
27 _unlocked = true