diff options
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r-- | Archipelago/client.gd | 81 |
1 files changed, 72 insertions, 9 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 7903df2..0944352 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -23,7 +23,7 @@ const ap_version = {"major": 0, "minor": 4, "build": 6, "class": "Version"} | |||
23 | const color_items = [ | 23 | const color_items = [ |
24 | "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" | 24 | "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" |
25 | ] | 25 | ] |
26 | const progressive_items = { | 26 | const door_progressive_items = { |
27 | "Progressive Orange Tower": | 27 | "Progressive Orange Tower": |
28 | ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"], | 28 | ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"], |
29 | "Progressive Art Gallery": | 29 | "Progressive Art Gallery": |
@@ -35,6 +35,40 @@ const progressive_items = { | |||
35 | "Progressive Pilgrimage": | 35 | "Progressive Pilgrimage": |
36 | ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"] | 36 | ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"] |
37 | } | 37 | } |
38 | const panel_progressive_items = { | ||
39 | "Progressive Hallway Room": | ||
40 | [ | ||
41 | {"item": "Hallway Room - First Room Panels", "display": "First Door"}, | ||
42 | {"item": "Hallway Room - Second Room Panels", "display": "Second Door"}, | ||
43 | {"item": "Hallway Room - Third Room Panels", "display": "Third Door"}, | ||
44 | {"item": "Hallway Room - WHEEL", "display": "Fourth Door"}, | ||
45 | ], | ||
46 | "Progressive Colorful": | ||
47 | [ | ||
48 | {"item": "The Colorful - BEGIN (Panel)", "display": "White"}, | ||
49 | {"item": "The Colorful - FOUND (Panel)", "display": "Black"}, | ||
50 | {"item": "The Colorful - LOAF (Panel)", "display": "Red"}, | ||
51 | {"item": "The Colorful - CREAM (Panel)", "display": "Yellow"}, | ||
52 | {"item": "The Colorful - SUN (Panel)", "display": "Blue"}, | ||
53 | {"item": "The Colorful - SPOON (Panel)", "display": "Purple"}, | ||
54 | {"item": "The Colorful - LETTERS (Panel)", "display": "Orange"}, | ||
55 | {"item": "The Colorful - WALLS (Panel)", "display": "Green"}, | ||
56 | {"item": "The Colorful - IRON (Panel)", "display": "Brown"}, | ||
57 | {"item": "The Colorful - OBSTACLE (Panel)", "display": "Gray"}, | ||
58 | ], | ||
59 | "Progressive Number Hunt": | ||
60 | [ | ||
61 | {"item": "Two Panels", "display": "Two"}, | ||
62 | {"item": "Three Panels", "display": "Three"}, | ||
63 | {"item": "Four Panels", "display": "Four"}, | ||
64 | {"item": "Five Panels", "display": "Five"}, | ||
65 | {"item": "Six Panels", "display": "Six"}, | ||
66 | {"item": "Seven Panels", "display": "Seven"}, | ||
67 | {"item": "Eight Panels", "display": "Eight"}, | ||
68 | {"item": "Nine Panels", "display": "Nine"}, | ||
69 | {"item": "Outside The Undeterred - ZERO (Panel)", "display": "Zero"}, | ||
70 | ] | ||
71 | } | ||
38 | 72 | ||
39 | const kTHE_END = 0 | 73 | const kTHE_END = 0 |
40 | const kTHE_MASTER = 1 | 74 | const kTHE_MASTER = 1 |
@@ -87,6 +121,7 @@ var _localdata_file = "" | |||
87 | var _death_link = false | 121 | var _death_link = false |
88 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 | 122 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 |
89 | var _door_shuffle = false | 123 | var _door_shuffle = false |
124 | var _panel_door_shuffle = false | ||
90 | var _color_shuffle = false | 125 | var _color_shuffle = false |
91 | var _panel_shuffle = 0 # none, rearrange | 126 | var _panel_shuffle = 0 # none, rearrange |
92 | var _painting_shuffle = false | 127 | var _painting_shuffle = false |
@@ -266,7 +301,12 @@ func _on_data(): | |||
266 | if _slot_data.has("shuffle_colors"): | 301 | if _slot_data.has("shuffle_colors"): |
267 | _color_shuffle = _slot_data["shuffle_colors"] | 302 | _color_shuffle = _slot_data["shuffle_colors"] |
268 | if _slot_data.has("shuffle_doors"): | 303 | if _slot_data.has("shuffle_doors"): |
269 | _door_shuffle = (_slot_data["shuffle_doors"] > 0) | 304 | if _slot_data.has("group_doors"): |
305 | _door_shuffle = (_slot_data["shuffle_doors"] == 2) | ||
306 | _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1) | ||
307 | else: | ||
308 | _door_shuffle = (_slot_data["shuffle_doors"] > 0) | ||
309 | _panel_door_shuffle = false | ||
270 | if _slot_data.has("shuffle_paintings"): | 310 | if _slot_data.has("shuffle_paintings"): |
271 | _painting_shuffle = _slot_data["shuffle_paintings"] | 311 | _painting_shuffle = _slot_data["shuffle_paintings"] |
272 | if _slot_data.has("shuffle_panels"): | 312 | if _slot_data.has("shuffle_panels"): |
@@ -680,6 +720,12 @@ func processItem(item, index, from, flags): | |||
680 | for door_id in gamedata.door_ids_by_item_id[int(item)]: | 720 | for door_id in gamedata.door_ids_by_item_id[int(item)]: |
681 | doorsNode.get_node(door_id).openDoor() | 721 | doorsNode.get_node(door_id).openDoor() |
682 | 722 | ||
723 | if gamedata.panel_ids_by_item_id.has(int(item)): | ||
724 | var panelsNode = get_tree().get_root().get_node("Spatial/Panels") | ||
725 | for panel_id in gamedata.panel_ids_by_item_id[int(item)]: | ||
726 | panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false | ||
727 | emit_signal("evaluate_solvability") | ||
728 | |||
683 | if gamedata.painting_ids_by_item_id.has(int(item)): | 729 | if gamedata.painting_ids_by_item_id.has(int(item)): |
684 | var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") | 730 | var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") |
685 | var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") | 731 | var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") |
@@ -700,13 +746,26 @@ func processItem(item, index, from, flags): | |||
700 | warpsNode.get_node(warp_id).unlock_warp() | 746 | warpsNode.get_node(warp_id).unlock_warp() |
701 | 747 | ||
702 | # Handle progressive items. | 748 | # Handle progressive items. |
703 | if int(item) in gamedata.items_by_progressive_id.keys(): | 749 | var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id |
750 | var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id | ||
751 | var progitems = null | ||
752 | |||
753 | if is_progressive_door and is_progressive_panel: | ||
754 | if _door_shuffle: | ||
755 | progitems = gamedata.door_items_by_progressive_id[int(item)] | ||
756 | else: | ||
757 | progitems = gamedata.panel_items_by_progressive_id[int(item)] | ||
758 | elif is_progressive_door: | ||
759 | progitems = gamedata.door_items_by_progressive_id[int(item)] | ||
760 | elif is_progressive_panel: | ||
761 | progitems = gamedata.panel_items_by_progressive_id[int(item)] | ||
762 | |||
763 | if progitems != null: | ||
704 | if not int(item) in _progressive_progress: | 764 | if not int(item) in _progressive_progress: |
705 | _progressive_progress[int(item)] = 0 | 765 | _progressive_progress[int(item)] = 0 |
706 | 766 | ||
707 | if _progressive_progress[int(item)] < gamedata.items_by_progressive_id[int(item)].size(): | 767 | if _progressive_progress[int(item)] < progitems.size(): |
708 | var subitems = gamedata.items_by_progressive_id[int(item)] | 768 | var subitem_id = progitems[_progressive_progress[int(item)]] |
709 | var subitem_id = subitems[_progressive_progress[int(item)]] | ||
710 | global._print("Subitem: %d" % subitem_id) | 769 | global._print("Subitem: %d" % subitem_id) |
711 | processItem(subitem_id, null, null, null) | 770 | processItem(subitem_id, null, null, null) |
712 | _progressive_progress[int(item)] += 1 | 771 | _progressive_progress[int(item)] += 1 |
@@ -722,9 +781,13 @@ func processItem(item, index, from, flags): | |||
722 | _last_new_item = index | 781 | _last_new_item = index |
723 | saveLocaldata() | 782 | saveLocaldata() |
724 | 783 | ||
725 | if item_name in progressive_items: | 784 | if _door_shuffle and item_name in door_progressive_items: |
726 | var subitem = progressive_items[item_name][_progressive_progress[int(item)] - 1] | 785 | var subitem = door_progressive_items[item_name][_progressive_progress[int(item)] - 1] |
727 | item_name += " (%s)" % subitem | 786 | item_name += " (%s)" % subitem["display"] |
787 | |||
788 | if _panel_door_shuffle and item_name in panel_progressive_items: | ||
789 | var subitem = panel_progressive_items[item_name][_progressive_progress[int(item)] - 1] | ||
790 | item_name += " (%s)" % subitem["display"] | ||
728 | 791 | ||
729 | var player_name = "Unknown" | 792 | var player_name = "Unknown" |
730 | if _player_name_by_slot.has(from): | 793 | if _player_name_by_slot.has(from): |