diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-10-10 15:13:50 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-10-10 15:13:50 -0400 |
commit | 3d7efa558252e9c3e0ef5d2708c525ad06ae5e86 (patch) | |
tree | 5cdaff3e09210b4226375aed5943df7bb299b270 | |
parent | 8b0d1293d98fff5d58dcc824e7eaefa6a7530fc1 (diff) | |
download | lingo-archipelago-3d7efa558252e9c3e0ef5d2708c525ad06ae5e86.tar.gz lingo-archipelago-3d7efa558252e9c3e0ef5d2708c525ad06ae5e86.tar.bz2 lingo-archipelago-3d7efa558252e9c3e0ef5d2708c525ad06ae5e86.zip |
Tell player if location was hinted
-rw-r--r-- | Archipelago/client.gd | 31 |
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 | |||
121 | var _cached_speed_boosts = 0 | 121 | var _cached_speed_boosts = 0 |
122 | var _geronimo_skip = false | 122 | var _geronimo_skip = false |
123 | var _checked_paintings = [] | 123 | var _checked_paintings = [] |
124 | var _hints_key = "" | ||
125 | var _hinted_locations = [] | ||
124 | 126 | ||
125 | signal could_not_connect | 127 | signal could_not_connect |
126 | signal connect_status | 128 | signal 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 | ||
530 | func _process(_delta): | 547 | func _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 | ||
883 | func 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 | |||
866 | func colorForItemType(flags): | 891 | func 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 |