diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-25 12:09:50 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-25 12:09:50 -0400 |
commit | 3f53502a5907ed1982d28a392c54331f0c1c2c42 (patch) | |
tree | 1dd087464d0fba1c35feaab0cee357fca6f2763c /apworld/client/worldport.gd | |
parent | fb220e1c75e72a536c19aa1283f905850a91cf44 (diff) | |
download | lingo2-archipelago-3f53502a5907ed1982d28a392c54331f0c1c2c42.tar.gz lingo2-archipelago-3f53502a5907ed1982d28a392c54331f0c1c2c42.tar.bz2 lingo2-archipelago-3f53502a5907ed1982d28a392c54331f0c1c2c42.zip |
Move the client into the apworld
Only works on source right now, not as an apworld.
Diffstat (limited to 'apworld/client/worldport.gd')
-rw-r--r-- | apworld/client/worldport.gd | 53 |
1 files changed, 53 insertions, 0 deletions
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 @@ | |||
1 | extends "res://scripts/nodes/worldport.gd" | ||
2 | |||
3 | var absolute_rotation = false | ||
4 | var target_rotation = 0 | ||
5 | |||
6 | |||
7 | func _ready(): | ||
8 | var node_path = String( | ||
9 | get_tree().get_root().get_node("scene").get_path_to(self).get_concatenated_names() | ||
10 | ) | ||
11 | |||
12 | var ap = global.get_node("Archipelago") | ||
13 | |||
14 | if ap.shuffle_worldports: | ||
15 | var gamedata = global.get_node("Gamedata") | ||
16 | var port_id = gamedata.get_port_for_map_node_path(global.map, node_path) | ||
17 | if port_id != null: | ||
18 | if port_id in ap.port_pairings: | ||
19 | var target_port = gamedata.objects.get_ports()[ap.port_pairings[port_id]] | ||
20 | var target_room = gamedata.objects.get_rooms()[target_port.get_room_id()] | ||
21 | var target_map = gamedata.objects.get_maps()[target_room.get_map_id()] | ||
22 | |||
23 | exit = target_map.get_name() | ||
24 | entry_point.x = target_port.get_destination().get_x() | ||
25 | entry_point.y = target_port.get_destination().get_y() | ||
26 | entry_point.z = target_port.get_destination().get_z() | ||
27 | absolute_rotation = true | ||
28 | target_rotation = target_port.get_rotation() | ||
29 | sets_entry_point = true | ||
30 | invisible = false | ||
31 | fades = true | ||
32 | |||
33 | if global.map == "icarus" and exit == "daedalus": | ||
34 | if not ap.daedalus_roof_access: | ||
35 | entry_point = Vector3(58, 10, 0) | ||
36 | |||
37 | super._ready() | ||
38 | |||
39 | |||
40 | func bodyEntered(body): | ||
41 | if body.is_in_group("player"): | ||
42 | if absolute_rotation: | ||
43 | entry_rotate.y = target_rotation - body.rotation_degrees.y | ||
44 | |||
45 | super.bodyEntered(body) | ||
46 | |||
47 | |||
48 | func changeScene(): | ||
49 | var player = get_tree().get_root().get_node("scene/player") | ||
50 | if player != null: | ||
51 | player.playable = false | ||
52 | |||
53 | super.changeScene() | ||