about summary refs log tree commit diff stats
path: root/Archipelago/client.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-10-10 15:13:50 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-10-10 15:13:50 -0400
commit3d7efa558252e9c3e0ef5d2708c525ad06ae5e86 (patch)
tree5cdaff3e09210b4226375aed5943df7bb299b270 /Archipelago/client.gd
parent8b0d1293d98fff5d58dcc824e7eaefa6a7530fc1 (diff)
downloadlingo-archipelago-3d7efa558252e9c3e0ef5d2708c525ad06ae5e86.tar.gz
lingo-archipelago-3d7efa558252e9c3e0ef5d2708c525ad06ae5e86.tar.bz2
lingo-archipelago-3d7efa558252e9c3e0ef5d2708c525ad06ae5e86.zip
Tell player if location was hinted
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r--Archipelago/client.gd31
1 files changed, 28 insertions, 3 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 1d8e779..01f812c 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -121,6 +121,8 @@ var _cached_atbash = 0
121var _cached_speed_boosts = 0 121var _cached_speed_boosts = 0
122var _geronimo_skip = false 122var _geronimo_skip = false
123var _checked_paintings = [] 123var _checked_paintings = []
124var _hints_key = ""
125var _hinted_locations = []
124 126
125signal could_not_connect 127signal could_not_connect
126signal connect_status 128signal connect_status
@@ -403,6 +405,11 @@ func _on_data():
403 ] 405 ]
404 ) 406 )
405 407
408 _hints_key = "_read_hints_%d_%d" % [_team, _slot]
409 sendMessage(
410 [{"cmd": "SetNotify", "keys": [_hints_key]}, {"cmd": "Get", "keys": [_hints_key]}]
411 )
412
406 emit_signal("client_connected") 413 emit_signal("client_connected")
407 414
408 elif cmd == "ConnectionRefused": 415 elif cmd == "ConnectionRefused":
@@ -500,9 +507,12 @@ func _on_data():
500 ) 507 )
501 else: 508 else:
502 if message["receiving"] != _slot: 509 if message["receiving"] != _slot:
503 messages.showMessage( 510 var sentMsg = (
504 "Sent [color=%s]%s[/color] to %s" % [item_color, item_name, player_name] 511 "Sent [color=%s]%s[/color] to %s" % [item_color, item_name, player_name]
505 ) 512 )
513 if _hinted_locations.has(message["item"]["location"]):
514 sentMsg += " ([color=#fafad2]Hinted![/color])"
515 messages.showMessage(sentMsg)
506 516
507 elif cmd == "Bounced": 517 elif cmd == "Bounced":
508 if ( 518 if (
@@ -523,8 +533,15 @@ func _on_data():
523 get_tree().get_root().get_node("Spatial/player/pause_menu")._reload() 533 get_tree().get_root().get_node("Spatial/player/pause_menu")._reload()
524 534
525 elif cmd == "SetReply": 535 elif cmd == "SetReply":
526 if message.has("key") and message["key"] == ("Lingo_%d_Paintings" % _slot): 536 if message.has("key"):
527 _checked_paintings = message["value"] 537 if message["key"] == ("Lingo_%d_Paintings" % _slot):
538 _checked_paintings = message["value"]
539 elif message["key"] == _hints_key:
540 parseHints(message["value"])
541
542 elif cmd == "Retrieved":
543 if message.has("keys") and message["keys"].has(_hints_key):
544 parseHints(message["keys"][_hints_key])
528 545
529 546
530func _process(_delta): 547func _process(_delta):
@@ -863,6 +880,14 @@ func checkPainting(painting_id):
863 setValue("Paintings", [painting_id], "add") 880 setValue("Paintings", [painting_id], "add")
864 881
865 882
883func parseHints(hints):
884 _hinted_locations.clear()
885
886 for hint in hints:
887 if hint["finding_player"] == int(_slot):
888 _hinted_locations.append(hint["location"])
889
890
866func colorForItemType(flags): 891func colorForItemType(flags):
867 var int_flags = int(flags) 892 var int_flags = int(flags)
868 if int_flags & 1: # progression 893 if int_flags & 1: # progression