about summary refs log tree commit diff stats
path: root/Archipelago
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago')
-rw-r--r--Archipelago/client.gd18
-rw-r--r--Archipelago/load.gd47
-rw-r--r--Archipelago/player.gd15
-rw-r--r--Archipelago/settings_screen.gd7
4 files changed, 83 insertions, 4 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 58a099c..1ba52d7 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -128,6 +128,7 @@ var _puzzle_skips = 0
128var _cached_slowness = 0 128var _cached_slowness = 0
129var _cached_iceland = 0 129var _cached_iceland = 0
130var _cached_atbash = 0 130var _cached_atbash = 0
131var _geronimo_skip = false
131 132
132signal could_not_connect 133signal could_not_connect
133signal connect_status 134signal connect_status
@@ -329,6 +330,11 @@ func _on_data():
329 else: 330 else:
330 _cached_atbash = 0 331 _cached_atbash = 0
331 332
333 if localdata.size() > 5:
334 _geronimo_skip = localdata[5]
335 else:
336 _geronimo_skip = false
337
332 requestSync() 338 requestSync()
333 339
334 emit_signal("client_connected") 340 emit_signal("client_connected")
@@ -488,7 +494,8 @@ func saveLocaldata():
488 _puzzle_skips, 494 _puzzle_skips,
489 effects_node.slowness_remaining, 495 effects_node.slowness_remaining,
490 effects_node.iceland_remaining, 496 effects_node.iceland_remaining,
491 effects_node.atbash_remaining 497 effects_node.atbash_remaining,
498 _geronimo_skip
492 ] 499 ]
493 file.store_var(data, true) 500 file.store_var(data, true)
494 file.close() 501 file.close()
@@ -733,6 +740,15 @@ func usePuzzleSkip():
733 saveLocaldata() 740 saveLocaldata()
734 741
735 742
743func geronimo():
744 if !_geronimo_skip:
745 messages.showMessage("Geronimo! You found a puzzle skip.")
746
747 _puzzle_skips += 1
748 _geronimo_skip = true
749 saveLocaldata()
750
751
736func colorForItemType(flags): 752func colorForItemType(flags):
737 var int_flags = int(flags) 753 var int_flags = int(flags)
738 if int_flags & 1: # progression 754 if int_flags & 1: # progression
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):
diff --git a/Archipelago/player.gd b/Archipelago/player.gd index 87d9d0c..244d9a8 100644 --- a/Archipelago/player.gd +++ b/Archipelago/player.gd
@@ -1,5 +1,13 @@
1extends "res://scripts/player.gd" 1extends "res://scripts/player.gd"
2 2
3var april_fools = false
4
5
6func _ready():
7 var date = Time.get_date_dict_from_system()
8 if date["month"] == 4 && date["day"] == 1:
9 april_fools = true
10
3 11
4func _solving(): 12func _solving():
5 ._solving() 13 ._solving()
@@ -22,3 +30,10 @@ func _unhandled_input(event):
22 if event.pressed and event.scancode == KEY_P: 30 if event.pressed and event.scancode == KEY_P:
23 var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects") 31 var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects")
24 effects_node.skip_puzzle() 32 effects_node.skip_puzzle()
33
34
35func rotate_y(amount):
36 if april_fools:
37 .rotate_y(-amount)
38 else:
39 .rotate_y(amount)
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 2cabe09..7f50f51 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd
@@ -104,8 +104,13 @@ func connectionSuccessful():
104 104
105 # Switch to LL1 105 # Switch to LL1
106 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 106 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
107 global.map = "level1"
108 global.save_file = apclient.getSaveFileName() 107 global.save_file = apclient.getSaveFileName()
108
109 if Directory.new().file_exists("user://level1/%s.save" % global.save_file):
110 global.map = "level1"
111 else:
112 global.map = "level1_stable"
113
109 var _discard = get_tree().change_scene("res://scenes/load_screen.tscn") 114 var _discard = get_tree().change_scene("res://scenes/load_screen.tscn")
110 115
111 116