about summary refs log tree commit diff stats
path: root/Archipelago/load.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-04-18 15:00:37 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-04-18 15:00:37 -0400
commitb882031250c7ad970852b8219deb99276f573833 (patch)
tree67472145a454a87129627104e5813bca9c4e2ff5 /Archipelago/load.gd
parent6bb60c1b8b4edaf454685fb74b0952baf2ad714f (diff)
parent6aad55fa66eb9caa668bb09289391e6b39eee7da (diff)
downloadlingo-archipelago-b882031250c7ad970852b8219deb99276f573833.tar.gz
lingo-archipelago-b882031250c7ad970852b8219deb99276f573833.tar.bz2
lingo-archipelago-b882031250c7ad970852b8219deb99276f573833.zip
Merge branch 'main' into sunwarps
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r--Archipelago/load.gd70
1 files changed, 57 insertions, 13 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 673c762..0ed978a 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd
@@ -25,6 +25,11 @@ func _load():
25 var apclient = global.get_node("Archipelago") 25 var apclient = global.get_node("Archipelago")
26 var panels_parent = self.get_node("Panels") 26 var panels_parent = self.get_node("Panels")
27 27
28 var date = Time.get_date_dict_from_system()
29 var april_fools = false
30 if date["month"] == 4 && date["day"] == 1:
31 april_fools = true
32
28 # Add a wall-blocked raycast to the player. 33 # Add a wall-blocked raycast to the player.
29 var wallcast = RayCast.new() 34 var wallcast = RayCast.new()
30 wallcast.name = "wallcast" 35 wallcast.name = "wallcast"
@@ -64,7 +69,7 @@ func _load():
64 wanderer_entrance.rotation = Vector3(0, -PI / 2, 0) 69 wanderer_entrance.rotation = Vector3(0, -PI / 2, 0)
65 wanderer_entrance.scale = Vector3(1, 1.5, 1) 70 wanderer_entrance.scale = Vector3(1, 1.5, 1)
66 wanderer_entrance.set_script(door_script) 71 wanderer_entrance.set_script(door_script)
67 wanderer_entrance.panels.append("../../../Panels/Tower Room/Panel_wanderlust_1234567890") 72 wanderer_entrance.panels = ["../../../Panels/Tower Room/Panel_wanderlust_1234567890"]
68 get_node("Doors/Tower Room Area Doors").add_child(wanderer_entrance) 73 get_node("Doors/Tower Room Area Doors").add_child(wanderer_entrance)
69 74
70 var wanderer_achieve = get_node("Panels/Tower Room/Panel_1234567890_wanderlust") 75 var wanderer_achieve = get_node("Panels/Tower Room/Panel_1234567890_wanderlust")
@@ -91,18 +96,19 @@ func _load():
91 96
92 wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map 97 wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map
93 98
94 # Turn THE COLORFUL into a cdp.
95 var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful")
96 var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") 99 var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn")
97 var colorful_cdp = cdp_auto_scene.instance() 100 if !apclient.wasGeneratedBeforeVersion(0, 4, 5):
98 colorful_cdp.name = "CountdownPanel_colorful" 101 # Turn THE COLORFUL into a cdp.
99 colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" 102 var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful")
100 colorful_cdp.panels = "../../Panels/Doorways Room" 103 var colorful_cdp = cdp_auto_scene.instance()
101 colorful_cdp.translation = real_colorful.translation 104 colorful_cdp.name = "CountdownPanel_colorful"
102 colorful_cdp.rotation = real_colorful.rotation 105 colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful"
103 get_node("CountdownPanels").add_child(colorful_cdp) 106 colorful_cdp.panels = "../../Panels/Doorways Room"
104 real_colorful.translation = Vector3(-51, -35, 35) # way under the map 107 colorful_cdp.translation = real_colorful.translation
105 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()
106 112
107 # Set up The Master to be variable. 113 # Set up The Master to be variable.
108 var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") 114 var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16")
@@ -420,6 +426,8 @@ func _load():
420 if not classes.has(painting): 426 if not classes.has(painting):
421 var i = rng.randi_range(0, all_paintings.size() - 1) 427 var i = rng.randi_range(0, all_paintings.size() - 1)
422 var chosen = all_paintings[i] 428 var chosen = all_paintings[i]
429 if april_fools:
430 chosen = "bg_notnerb"
423 classes[painting] = chosen 431 classes[painting] = chosen
424 all_paintings.remove(i) 432 all_paintings.remove(i)
425 433
@@ -444,6 +452,9 @@ func _load():
444 var j = rng.randi_range(0, all_paintings.size() - 1) 452 var j = rng.randi_range(0, all_paintings.size() - 1)
445 remaining.append(all_paintings[j]) 453 remaining.append(all_paintings[j])
446 all_paintings.remove(j) 454 all_paintings.remove(j)
455
456 if april_fools:
457 remaining = ["bg_notnerb"]
447 458
448 for painting in gamedata.paintings.keys(): 459 for painting in gamedata.paintings.keys():
449 if randomized.has(painting): 460 if randomized.has(painting):
@@ -451,6 +462,26 @@ func _load():
451 462
452 var chosen_painting = remaining[rng.randi_range(0, remaining.size() - 1)] 463 var chosen_painting = remaining[rng.randi_range(0, remaining.size() - 1)]
453 instantiate_painting(painting, chosen_painting) 464 instantiate_painting(painting, chosen_painting)
465
466 # Replace the roof of The Artistic.
467 var artistic_paintings = [
468 ["smile_painting_9", -49.5, 44.5],
469 ["cherry_painting3", -38.5, 44.5],
470 ["boxes_painting2", -38.5, 55.5],
471 ["panda_painting_3", -49.5, 55.5]
472 ]
473 for painting in artistic_paintings:
474 var painting_node = get_node("AP_Paintings").get_node(painting[0]).get_node("GridMap")
475 var small_mesh_library = painting_node.mesh_library
476
477 for x in range(0,10):
478 for y in range(0,10):
479 var cellitem = painting_node.get_cell_item(-5 + x, 1+y, 0)
480 var meshitem = small_mesh_library.get_item_name(cellitem)
481 if meshitem.begins_with("Tiny"):
482 meshitem = meshitem.substr(4)
483 set_gridmap_tile(painting[1]+9-y, 8.5, painting[2]+x, meshitem)
484
454 485
455 # We need to make some changes to the Art Gallery. The player should always 486 # We need to make some changes to the Art Gallery. The player should always
456 # have access to the backroom, but they shouldn't have access to ORDER until 487 # have access to the backroom, but they shouldn't have access to ORDER until
@@ -644,6 +675,17 @@ func _load():
644 var multiplayer_node = apclient.SCRIPT_multiplayer.new() 675 var multiplayer_node = apclient.SCRIPT_multiplayer.new()
645 multiplayer_node.ghost_mode = true 676 multiplayer_node.ghost_mode = true
646 add_child(multiplayer_node) 677 add_child(multiplayer_node)
678
679 # Hook up Geronimo handler.
680 $player.connect("player_jumped", apclient, "geronimo")
681
682 if april_fools:
683 # Change the appearance of every painting.
684 var notnerb_painting = load("res://nodes/paintings/bg_notnerb.tscn").instance()
685 for child in $Decorations/Paintings.get_children():
686 if child.get_node_or_null("GridMap") != null:
687 child.get_node("GridMap").queue_free()
688 child.add_child(notnerb_painting.get_node("GridMap").duplicate(true))
647 689
648 # Hook up the scene to be able to handle connection failures. 690 # Hook up the scene to be able to handle connection failures.
649 apclient.connect("could_not_connect", self, "archipelago_disconnected") 691 apclient.connect("could_not_connect", self, "archipelago_disconnected")
@@ -727,8 +769,10 @@ func set_gridmap_tile(x, y, z, tile):
727 var gridmap = self.get_node("GridMap") 769 var gridmap = self.get_node("GridMap")
728 var mesh_library = gridmap.mesh_library 770 var mesh_library = gridmap.mesh_library
729 var mapvec = gridmap.world_to_map(gridmap.to_local(Vector3(x, y, z))) 771 var mapvec = gridmap.world_to_map(gridmap.to_local(Vector3(x, y, z)))
772 var cellitem = mesh_library.find_item_by_name(tile)
730 773
731 gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, mesh_library.find_item_by_name(tile)) 774 if cellitem != GridMap.INVALID_CELL_ITEM:
775 gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, cellitem)
732 776
733 777
734func clear_gridmap_tile(x, y, z): 778func clear_gridmap_tile(x, y, z):