about summary refs log tree commit diff stats
path: root/client/Archipelago/teleport.gd
blob: 428d50b6e139162c93a655a030c7c9384704ac32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
extends "res://scripts/nodes/teleport.gd"

var item_id
var item_amount


func _ready():
	var node_path = String(
		get_tree().get_root().get_node("scene").get_path_to(self).get_concatenated_names()
	)

	var gamedata = global.get_node("Gamedata")
	var door_id = gamedata.get_door_for_map_node_path(global.map, node_path)
	if door_id != null:
		var ap = global.get_node("Archipelago")
		var item_lock = ap.get_item_id_for_door(door_id)

		if item_lock != null:
			item_id = item_lock[0]
			item_amount = item_lock[1]

			self.senders = []
			self.senderGroup = []
			self.nested = false
			self.complete_at = 0
			self.max_length = 0
			self.excludeSenders = []

			call_deferred("_readier")

	super._ready()


func _readier():
	var ap = global.get_node("Archipelago")

	if ap.client.getItemAmount(item_id) >= item_amount:
		handleTriggered()
ot;SERVER" align = 2 theme = ExtResource("2_g4bvn") [node name="credit5" parent="Panel" type="Label"] offset_left = 1239.0 offset_top = 422.0 offset_right = 1829.0 offset_bottom = 486.0 custom_styles/normal = SubResource( 1 ) text = "OPTIONS" theme = ExtResource("2_g4bvn") [node name="credit3" parent="Panel" type="Label"] offset_left = -105.0 offset_top = 519.0 offset_right = 485.0 offset_bottom = 583.0 custom_styles/normal = SubResource( 1 ) text = "PLAYER" align = 2 theme = ExtResource("2_g4bvn") [node name="credit4" parent="Panel" type="Label"] offset_left = -105.0 offset_top = 704.0 offset_right = 485.0 offset_bottom = 768.0 custom_styles/normal = SubResource( 1 ) text = "PASSWORD" align = 2 theme = ExtResource("2_g4bvn") [node name="server_box" type="LineEdit" parent="Panel"] offset_left = 502.0 offset_top = 295.0 offset_right = 1144.0 offset_bottom = 445.0 custom_colors/selection_color = Color( 0.482353, 0, 0, 1 ) custom_colors/cursor_color = Color( 0, 0, 0, 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_styles/focus = SubResource( 2 ) align = 1 caret_blink = true [node name="player_box" type="LineEdit" parent="Panel"] offset_left = 502.0 offset_top = 477.0 offset_right = 1144.0 offset_bottom = 627.0 custom_colors/selection_color = Color( 0.482353, 0, 0, 1 ) custom_colors/cursor_color = Color( 0, 0, 0, 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_styles/focus = SubResource( 2 ) align = 1 caret_blink = true [node name="password_box" type="LineEdit" parent="Panel"] offset_left = 502.0 offset_top = 659.0 offset_right = 1144.0 offset_bottom = 809.0 custom_colors/selection_color = Color( 0.482353, 0, 0, 1 ) custom_colors/cursor_color = Color( 0, 0, 0, 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_styles/focus = SubResource( 2 ) align = 1 caret_blink = true [node name="AcceptDialog" type="AcceptDialog" parent="Panel"] offset_right = 83.0 offset_bottom = 58.0 [node name="connection_history" type="MenuButton" parent="Panel"] offset_left = 1239.0 offset_top = 276.0 offset_right = 1829.0 offset_bottom = 372.0 text = "connection history" flat = false [connection signal="pressed" from="Panel/connect_button" to="Panel/connect_button" method="_connect_pressed"] [connection signal="pressed" from="Panel/quit_button" to="Panel/quit_button" method="_back_pressed"]