about summary refs log tree commit diff stats
path: root/Archipelago/load.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r--Archipelago/load.gd47
1 files changed, 45 insertions, 2 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 59d2ac2..566ee39 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")
@@ -418,6 +423,8 @@ func _load():
418 if not classes.has(painting): 423 if not classes.has(painting):
419 var i = rng.randi_range(0, all_paintings.size() - 1) 424 var i = rng.randi_range(0, all_paintings.size() - 1)
420 var chosen = all_paintings[i] 425 var chosen = all_paintings[i]
426 if april_fools:
427 chosen = "bg_notnerb"
421 classes[painting] = chosen 428 classes[painting] = chosen
422 all_paintings.remove(i) 429 all_paintings.remove(i)
423 430
@@ -442,6 +449,9 @@ func _load():
442 var j = rng.randi_range(0, all_paintings.size() - 1) 449 var j = rng.randi_range(0, all_paintings.size() - 1)
443 remaining.append(all_paintings[j]) 450 remaining.append(all_paintings[j])
444 all_paintings.remove(j) 451 all_paintings.remove(j)
452
453 if april_fools:
454 remaining = ["bg_notnerb"]
445 455
446 for painting in gamedata.paintings.keys(): 456 for painting in gamedata.paintings.keys():
447 if randomized.has(painting): 457 if randomized.has(painting):
@@ -449,6 +459,26 @@ func _load():
449 459
450 var chosen_painting = remaining[rng.randi_range(0, remaining.size() - 1)] 460 var chosen_painting = remaining[rng.randi_range(0, remaining.size() - 1)]
451 instantiate_painting(painting, chosen_painting) 461 instantiate_painting(painting, chosen_painting)
462
463 # Replace the roof of The Artistic.
464 var artistic_paintings = [
465 ["smile_painting_9", -49.5, 44.5],
466 ["cherry_painting3", -38.5, 44.5],
467 ["boxes_painting2", -38.5, 55.5],
468 ["panda_painting_3", -49.5, 55.5]
469 ]
470 for painting in artistic_paintings:
471 var painting_node = get_node("AP_Paintings").get_node(painting[0]).get_node("GridMap")
472 var small_mesh_library = painting_node.mesh_library
473
474 for x in range(0,10):
475 for y in range(0,10):
476 var cellitem = painting_node.get_cell_item(-5 + x, 1+y, 0)
477 var meshitem = small_mesh_library.get_item_name(cellitem)
478 if meshitem.begins_with("Tiny"):
479 meshitem = meshitem.substr(4)
480 set_gridmap_tile(painting[1]+9-y, 8.5, painting[2]+x, meshitem)
481
452 482
453 # We need to make some changes to the Art Gallery. The player should always 483 # We need to make some changes to the Art Gallery. The player should always
454 # have access to the backroom, but they shouldn't have access to ORDER until 484 # have access to the backroom, but they shouldn't have access to ORDER until
@@ -569,6 +599,17 @@ func _load():
569 var multiplayer_node = apclient.SCRIPT_multiplayer.new() 599 var multiplayer_node = apclient.SCRIPT_multiplayer.new()
570 multiplayer_node.ghost_mode = true 600 multiplayer_node.ghost_mode = true
571 add_child(multiplayer_node) 601 add_child(multiplayer_node)
602
603 # Hook up Geronimo handler.
604 $player.connect("player_jumped", apclient, "geronimo")
605
606 if april_fools:
607 # Change the appearance of every painting.
608 var notnerb_painting = load("res://nodes/paintings/bg_notnerb.tscn").instance()
609 for child in $Decorations/Paintings.get_children():
610 if child.get_node_or_null("GridMap") != null:
611 child.get_node("GridMap").queue_free()
612 child.add_child(notnerb_painting.get_node("GridMap").duplicate(true))
572 613
573 # Hook up the scene to be able to handle connection failures. 614 # Hook up the scene to be able to handle connection failures.
574 apclient.connect("could_not_connect", self, "archipelago_disconnected") 615 apclient.connect("could_not_connect", self, "archipelago_disconnected")
@@ -652,8 +693,10 @@ func set_gridmap_tile(x, y, z, tile):
652 var gridmap = self.get_node("GridMap") 693 var gridmap = self.get_node("GridMap")
653 var mesh_library = gridmap.mesh_library 694 var mesh_library = gridmap.mesh_library
654 var mapvec = gridmap.world_to_map(gridmap.to_local(Vector3(x, y, z))) 695 var mapvec = gridmap.world_to_map(gridmap.to_local(Vector3(x, y, z)))
696 var cellitem = mesh_library.find_item_by_name(tile)
655 697
656 gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, mesh_library.find_item_by_name(tile)) 698 if cellitem != GridMap.INVALID_CELL_ITEM:
699 gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, cellitem)
657 700
658 701
659func clear_gridmap_tile(x, y, z): 702func clear_gridmap_tile(x, y, z):