diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-22 12:07:02 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-22 12:07:02 -0400 |
commit | 1157a68696ba5766a8d134bac5904de8ede6680f (patch) | |
tree | ef292370088516c41516d331fa3e9c372a166d3a /client/Archipelago/worldport.gd | |
parent | 424f5d4a830fb43f86c76d73d795412890d55bc2 (diff) | |
download | lingo2-archipelago-1157a68696ba5766a8d134bac5904de8ede6680f.tar.gz lingo2-archipelago-1157a68696ba5766a8d134bac5904de8ede6680f.tar.bz2 lingo2-archipelago-1157a68696ba5766a8d134bac5904de8ede6680f.zip |
[Client] Handle worldport shuffle
Diffstat (limited to 'client/Archipelago/worldport.gd')
-rw-r--r-- | client/Archipelago/worldport.gd | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/client/Archipelago/worldport.gd b/client/Archipelago/worldport.gd index d0fb6c9..cdca248 100644 --- a/client/Archipelago/worldport.gd +++ b/client/Archipelago/worldport.gd | |||
@@ -1,10 +1,53 @@ | |||
1 | extends "res://scripts/nodes/worldport.gd" | 1 | extends "res://scripts/nodes/worldport.gd" |
2 | 2 | ||
3 | var absolute_rotation = false | ||
4 | var target_rotation = 0 | ||
5 | |||
3 | 6 | ||
4 | func _ready(): | 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 | |||
5 | if global.map == "icarus" and exit == "daedalus": | 33 | if global.map == "icarus" and exit == "daedalus": |
6 | var ap = global.get_node("Archipelago") | ||
7 | if not ap.daedalus_roof_access: | 34 | if not ap.daedalus_roof_access: |
8 | entry_point = Vector3(58, 10, 0) | 35 | entry_point = Vector3(58, 10, 0) |
9 | 36 | ||
10 | super._ready() | 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() | ||