diff options
Diffstat (limited to 'client/Archipelago/manager.gd')
| -rw-r--r-- | client/Archipelago/manager.gd | 36 |
1 files changed, 33 insertions, 3 deletions
| diff --git a/client/Archipelago/manager.gd b/client/Archipelago/manager.gd index 6eea2bd..218870c 100644 --- a/client/Archipelago/manager.gd +++ b/client/Archipelago/manager.gd | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | extends Node | 1 | extends Node |
| 2 | 2 | ||
| 3 | const MOD_VERSION = 0 | 3 | const MOD_VERSION = 7 |
| 4 | 4 | ||
| 5 | var SCRIPT_client | 5 | var SCRIPT_client |
| 6 | var SCRIPT_keyboard | 6 | var SCRIPT_keyboard |
| @@ -12,6 +12,7 @@ var ap_server = "" | |||
| 12 | var ap_user = "" | 12 | var ap_user = "" |
| 13 | var ap_pass = "" | 13 | var ap_pass = "" |
| 14 | var connection_history = [] | 14 | var connection_history = [] |
| 15 | var show_compass = false | ||
| 15 | 16 | ||
| 16 | var client | 17 | var client |
| 17 | var keyboard | 18 | var keyboard |
| @@ -41,13 +42,17 @@ const kCYAN_DOOR_BEHAVIOR_H2 = 0 | |||
| 41 | const kCYAN_DOOR_BEHAVIOR_DOUBLE_LETTER = 1 | 42 | const kCYAN_DOOR_BEHAVIOR_DOUBLE_LETTER = 1 |
| 42 | const kCYAN_DOOR_BEHAVIOR_ITEM = 2 | 43 | const kCYAN_DOOR_BEHAVIOR_ITEM = 2 |
| 43 | 44 | ||
| 45 | var apworld_version = [0, 0] | ||
| 44 | var cyan_door_behavior = kCYAN_DOOR_BEHAVIOR_H2 | 46 | var cyan_door_behavior = kCYAN_DOOR_BEHAVIOR_H2 |
| 45 | var daedalus_roof_access = false | 47 | var daedalus_roof_access = false |
| 46 | var keyholder_sanity = false | 48 | var keyholder_sanity = false |
| 47 | var shuffle_control_center_colors = false | 49 | var shuffle_control_center_colors = false |
| 48 | var shuffle_doors = false | 50 | var shuffle_doors = false |
| 51 | var shuffle_gallery_paintings = false | ||
| 49 | var shuffle_letters = kSHUFFLE_LETTERS_VANILLA | 52 | var shuffle_letters = kSHUFFLE_LETTERS_VANILLA |
| 50 | var shuffle_symbols = false | 53 | var shuffle_symbols = false |
| 54 | var strict_cyan_ending = false | ||
| 55 | var strict_purple_ending = false | ||
| 51 | var victory_condition = -1 | 56 | var victory_condition = -1 |
| 52 | 57 | ||
| 53 | signal could_not_connect | 58 | signal could_not_connect |
| @@ -78,6 +83,9 @@ func _init(): | |||
| 78 | if data.size() > 3: | 83 | if data.size() > 3: |
| 79 | connection_history = data[3] | 84 | connection_history = data[3] |
| 80 | 85 | ||
| 86 | if data.size() > 4: | ||
| 87 | show_compass = data[4] | ||
| 88 | |||
| 81 | 89 | ||
| 82 | func _ready(): | 90 | func _ready(): |
| 83 | client = SCRIPT_client.new() | 91 | client = SCRIPT_client.new() |
| @@ -106,6 +114,7 @@ func saveSettings(): | |||
| 106 | ap_user, | 114 | ap_user, |
| 107 | ap_pass, | 115 | ap_pass, |
| 108 | connection_history, | 116 | connection_history, |
| 117 | show_compass, | ||
| 109 | ] | 118 | ] |
| 110 | file.store_var(data, true) | 119 | file.store_var(data, true) |
| 111 | file.close() | 120 | file.close() |
| @@ -213,6 +222,9 @@ func _process_item(item, index, from, flags, amount): | |||
| 213 | "Received [color=%s]%s[/color] from %s" % [item_color, full_item_name, player_name] | 222 | "Received [color=%s]%s[/color] from %s" % [item_color, full_item_name, player_name] |
| 214 | ) | 223 | ) |
| 215 | 224 | ||
| 225 | if gamedata.anti_trap_ids.has(item): | ||
| 226 | keyboard.block_letter(gamedata.anti_trap_ids[item]) | ||
| 227 | |||
| 216 | global._print(message) | 228 | global._print(message) |
| 217 | 229 | ||
| 218 | global.get_node("Messages").showMessage(message) | 230 | global.get_node("Messages").showMessage(message) |
| @@ -307,6 +319,10 @@ func parse_printjson_for_textclient(message): | |||
| 307 | func _process_location_scout(item_id, location_id, player, flags): | 319 | func _process_location_scout(item_id, location_id, player, flags): |
| 308 | _location_scouts[location_id] = {"item": item_id, "player": player, "flags": flags} | 320 | _location_scouts[location_id] = {"item": item_id, "player": player, "flags": flags} |
| 309 | 321 | ||
| 322 | if player == client._slot and flags & 4 != 0: | ||
| 323 | # This is a trap for us, so let's not display it. | ||
| 324 | return | ||
| 325 | |||
| 310 | var gamedata = global.get_node("Gamedata") | 326 | var gamedata = global.get_node("Gamedata") |
| 311 | var map_id = gamedata.map_id_by_name.get(global.map) | 327 | var map_id = gamedata.map_id_by_name.get(global.map) |
| 312 | 328 | ||
| @@ -327,8 +343,8 @@ func _process_location_scout(item_id, location_id, player, flags): | |||
| 327 | collectable.setScoutedText(item_name) | 343 | collectable.setScoutedText(item_name) |
| 328 | 344 | ||
| 329 | 345 | ||
| 330 | func _client_could_not_connect(): | 346 | func _client_could_not_connect(message): |
| 331 | emit_signal("could_not_connect") | 347 | emit_signal("could_not_connect", message) |
| 332 | 348 | ||
| 333 | 349 | ||
| 334 | func _client_connect_status(message): | 350 | func _client_connect_status(message): |
| @@ -361,10 +377,16 @@ func _client_connected(slot_data): | |||
| 361 | keyholder_sanity = bool(slot_data.get("keyholder_sanity", false)) | 377 | keyholder_sanity = bool(slot_data.get("keyholder_sanity", false)) |
| 362 | shuffle_control_center_colors = bool(slot_data.get("shuffle_control_center_colors", false)) | 378 | shuffle_control_center_colors = bool(slot_data.get("shuffle_control_center_colors", false)) |
| 363 | shuffle_doors = bool(slot_data.get("shuffle_doors", false)) | 379 | shuffle_doors = bool(slot_data.get("shuffle_doors", false)) |
| 380 | shuffle_gallery_paintings = bool(slot_data.get("shuffle_gallery_paintings", false)) | ||
| 364 | shuffle_letters = int(slot_data.get("shuffle_letters", 0)) | 381 | shuffle_letters = int(slot_data.get("shuffle_letters", 0)) |
| 365 | shuffle_symbols = bool(slot_data.get("shuffle_symbols", false)) | 382 | shuffle_symbols = bool(slot_data.get("shuffle_symbols", false)) |
| 383 | strict_cyan_ending = bool(slot_data.get("strict_cyan_ending", false)) | ||
| 384 | strict_purple_ending = bool(slot_data.get("strict_purple_ending", false)) | ||
| 366 | victory_condition = int(slot_data.get("victory_condition", 0)) | 385 | victory_condition = int(slot_data.get("victory_condition", 0)) |
| 367 | 386 | ||
| 387 | if slot_data.has("version"): | ||
| 388 | apworld_version = [int(slot_data["version"][0]), int(slot_data["version"][1])] | ||
| 389 | |||
| 368 | # Set up item locks. | 390 | # Set up item locks. |
| 369 | _item_locks = {} | 391 | _item_locks = {} |
| 370 | 392 | ||
| @@ -399,6 +421,11 @@ func _client_connected(slot_data): | |||
| 399 | for door in door_group.get_doors(): | 421 | for door in door_group.get_doors(): |
| 400 | _item_locks[door] = [door_group.get_ap_id(), 1] | 422 | _item_locks[door] = [door_group.get_ap_id(), 1] |
| 401 | 423 | ||
| 424 | if shuffle_gallery_paintings: | ||
| 425 | for door in gamedata.objects.get_doors(): | ||
| 426 | if door.get_type() == gamedata.SCRIPT_proto.DoorType.GALLERY_PAINTING: | ||
| 427 | _item_locks[door.get_id()] = [door.get_ap_id(), 1] | ||
| 428 | |||
| 402 | if cyan_door_behavior == kCYAN_DOOR_BEHAVIOR_ITEM: | 429 | if cyan_door_behavior == kCYAN_DOOR_BEHAVIOR_ITEM: |
| 403 | for door_group in gamedata.objects.get_door_groups(): | 430 | for door_group in gamedata.objects.get_door_groups(): |
| 404 | if door_group.get_type() == gamedata.SCRIPT_proto.DoorGroupType.CYAN_DOORS: | 431 | if door_group.get_type() == gamedata.SCRIPT_proto.DoorGroupType.CYAN_DOORS: |
| @@ -511,4 +538,7 @@ func _process_key_item(key, level): | |||
| 511 | _held_letters[key] = max(_held_letters.get(key, 0), level) | 538 | _held_letters[key] = max(_held_letters.get(key, 0), level) |
| 512 | return | 539 | return |
| 513 | 540 | ||
| 541 | if shuffle_letters == kSHUFFLE_LETTERS_ITEM_CYAN: | ||
| 542 | level += 1 | ||
| 543 | |||
| 514 | keyboard.collect_remote_letter(key, level) | 544 | keyboard.collect_remote_letter(key, level) |
