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.gd87
1 files changed, 87 insertions, 0 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 2d5f7c6..0750247 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd
@@ -334,6 +334,8 @@ func _load():
334 victory_condition = "the master" 334 victory_condition = "the master"
335 elif apclient._victory_condition == apclient.kLEVEL_2: 335 elif apclient._victory_condition == apclient.kLEVEL_2:
336 victory_condition = "level 2" 336 victory_condition = "level 2"
337 elif apclient._victory_condition == apclient.kPILGRIMAGE:
338 victory_condition = "pilgrimage"
337 339
338 set_static_panel("Entry Room/Panel_this_this", victory_condition) 340 set_static_panel("Entry Room/Panel_this_this", victory_condition)
339 set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") 341 set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo")
@@ -538,11 +540,84 @@ func _load():
538 level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( 540 level_2.get_node("Viewport/GUI/Panel/TextEdit").connect(
539 "answer_correct", apclient, "completedGoal" 541 "answer_correct", apclient, "completedGoal"
540 ) 542 )
543 elif apclient._victory_condition == apclient.kPILGRIMAGE:
544 var pilgrim_panel = self.get_node("Panels/Lingo Room/Panel_pilgrim")
545 pilgrim_panel.get_node("Viewport/GUI/Panel/TextEdit").connect(
546 "answer_correct", apclient, "completedGoal"
547 )
541 else: 548 else:
542 var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") 549 var the_end = self.get_node("Decorations/EndPanel/Panel_end_end")
543 the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( 550 the_end.get_node("Viewport/GUI/Panel/TextEdit").connect(
544 "answer_correct", apclient, "completedGoal" 551 "answer_correct", apclient, "completedGoal"
545 ) 552 )
553
554 # If pilgrimage does not allow roof access, add a node on the Crossroads
555 # Roof Access stairs that disables it.
556 if !apclient._pilgrimage_allows_roof_access:
557 var terminator = apclient.SCRIPT_pilgrimage_terminator.new()
558 terminator.name = "RoofAccessPilgrimageTerminator"
559 terminator.translation.x = -36
560 terminator.translation.y = 3
561 terminator.translation.z = -35
562
563 var terminator_shape = CollisionShape.new()
564 terminator_shape.shape = BoxShape.new()
565 terminator_shape.shape.extents.x = 0.1
566
567 terminator.add_child(terminator_shape)
568 get_node("Decorations").add_child(terminator)
569
570 if apclient._sunwarp_shuffle:
571 # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that.
572 get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0
573 get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0
574 get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0
575 get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0
576 get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90
577
578 get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5
579 get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5
580 get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5
581 get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5
582 get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5
583
584 # Change the sunwarps in accordance with the mapping.
585 var sw_orig_translations = []
586 var sw_text_translations = []
587 var sw_text_rotations = []
588 for i in range(1,7):
589 sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation)
590 sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation)
591 sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees)
592 for i in range(1,7):
593 sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation)
594 sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation)
595 sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees)
596
597 var sw_enter_indicators = [4, 5, 6, 12, 7, 10]
598 for i in range(1,7):
599 get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]]
600 get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]]
601
602 get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]]
603 get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]]
604
605 get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]]
606 get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]]
607
608 var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90
609 var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90
610 var final_rot = enter_rot - exit_rot
611 if final_rot < 0:
612 final_rot += 360
613 get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot)
614
615 var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"]
616 var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1])
617 sw_enter_indicator.translation.x = sw_enter_indicator_pos[0]
618 sw_enter_indicator.translation.y = sw_enter_indicator_pos[1]
619 sw_enter_indicator.translation.z = sw_enter_indicator_pos[2]
620 sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180
546 621
547 # Create the effects node. 622 # Create the effects node.
548 var effects_script = apclient.SCRIPT_effects 623 var effects_script = apclient.SCRIPT_effects
@@ -643,3 +718,15 @@ func set_small_gridmap_tile(x, y, z, tile):
643 718
644func archipelago_disconnected(reason): 719func archipelago_disconnected(reason):
645 messages.showMessage(reason) 720 messages.showMessage(reason)
721
722
723func _dir_to_int(dir):
724 if dir == "north":
725 return 0
726 elif dir == "west":
727 return 1
728 elif dir == "south":
729 return 2
730 elif dir == "east":
731 return 3
732 return 4