From 3f53502a5907ed1982d28a392c54331f0c1c2c42 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 25 Sep 2025 12:09:50 -0400 Subject: Move the client into the apworld Only works on source right now, not as an apworld. --- apworld/client/worldport.gd | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 apworld/client/worldport.gd (limited to 'apworld/client/worldport.gd') diff --git a/apworld/client/worldport.gd b/apworld/client/worldport.gd new file mode 100644 index 0000000..cdca248 --- /dev/null +++ b/apworld/client/worldport.gd @@ -0,0 +1,53 @@ +extends "res://scripts/nodes/worldport.gd" + +var absolute_rotation = false +var target_rotation = 0 + + +func _ready(): + var node_path = String( + get_tree().get_root().get_node("scene").get_path_to(self).get_concatenated_names() + ) + + var ap = global.get_node("Archipelago") + + if ap.shuffle_worldports: + var gamedata = global.get_node("Gamedata") + var port_id = gamedata.get_port_for_map_node_path(global.map, node_path) + if port_id != null: + if port_id in ap.port_pairings: + var target_port = gamedata.objects.get_ports()[ap.port_pairings[port_id]] + var target_room = gamedata.objects.get_rooms()[target_port.get_room_id()] + var target_map = gamedata.objects.get_maps()[target_room.get_map_id()] + + exit = target_map.get_name() + entry_point.x = target_port.get_destination().get_x() + entry_point.y = target_port.get_destination().get_y() + entry_point.z = target_port.get_destination().get_z() + absolute_rotation = true + target_rotation = target_port.get_rotation() + sets_entry_point = true + invisible = false + fades = true + + if global.map == "icarus" and exit == "daedalus": + if not ap.daedalus_roof_access: + entry_point = Vector3(58, 10, 0) + + super._ready() + + +func bodyEntered(body): + if body.is_in_group("player"): + if absolute_rotation: + entry_rotate.y = target_rotation - body.rotation_degrees.y + + super.bodyEntered(body) + + +func changeScene(): + var player = get_tree().get_root().get_node("scene/player") + if player != null: + player.playable = false + + super.changeScene() -- cgit 1.4.1