diff options
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r-- | Archipelago/client.gd | 57 |
1 files changed, 47 insertions, 10 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 01f812c..8cddb83 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -24,7 +24,7 @@ const ap_version = {"major": 0, "minor": 5, "build": 0, "class": "Version"} | |||
24 | const color_items = [ | 24 | const color_items = [ |
25 | "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" | 25 | "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" |
26 | ] | 26 | ] |
27 | const progressive_items = { | 27 | const door_progressive_items = { |
28 | "Progressive Orange Tower": | 28 | "Progressive Orange Tower": |
29 | ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"], | 29 | ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"], |
30 | "Progressive Art Gallery": | 30 | "Progressive Art Gallery": |
@@ -36,6 +36,15 @@ const progressive_items = { | |||
36 | "Progressive Pilgrimage": | 36 | "Progressive Pilgrimage": |
37 | ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"] | 37 | ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"] |
38 | } | 38 | } |
39 | const panel_progressive_items = { | ||
40 | "Progressive Hallway Room": ["First Door", "Second Door", "Third Door", "Fourth Door"], | ||
41 | "Progressive Colorful": | ||
42 | ["White", "Black", "Red", "Yellow", "Blue", "Purple", "Orange", "Green", "Brown", "Gray"], | ||
43 | "Progressive Number Hunt": | ||
44 | ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero"], | ||
45 | "Progressive Symmetry Room": ["Near Far", "Warts Straw", "Leaf Feel"], | ||
46 | "Progressive Suits Area": ["Words Sword", "Lost", "Amen Name"] | ||
47 | } | ||
39 | 48 | ||
40 | const kTHE_END = 0 | 49 | const kTHE_END = 0 |
41 | const kTHE_MASTER = 1 | 50 | const kTHE_MASTER = 1 |
@@ -90,6 +99,7 @@ var _localdata_file = "" | |||
90 | var _death_link = false | 99 | var _death_link = false |
91 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 | 100 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 |
92 | var _door_shuffle = false | 101 | var _door_shuffle = false |
102 | var _panel_door_shuffle = false | ||
93 | var _color_shuffle = false | 103 | var _color_shuffle = false |
94 | var _panel_shuffle = 0 # none, rearrange | 104 | var _panel_shuffle = 0 # none, rearrange |
95 | var _painting_shuffle = false | 105 | var _painting_shuffle = false |
@@ -280,9 +290,15 @@ func _on_data(): | |||
280 | _color_shuffle = _slot_data["shuffle_colors"] | 290 | _color_shuffle = _slot_data["shuffle_colors"] |
281 | 291 | ||
282 | if _slot_data.has("shuffle_doors"): | 292 | if _slot_data.has("shuffle_doors"): |
283 | _door_shuffle = (_slot_data["shuffle_doors"] > 0) | 293 | if _slot_data.has("group_doors"): |
294 | _door_shuffle = (_slot_data["shuffle_doors"] == 2) | ||
295 | _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1) | ||
296 | else: | ||
297 | _door_shuffle = (_slot_data["shuffle_doors"] > 0) | ||
298 | _panel_door_shuffle = false | ||
284 | else: | 299 | else: |
285 | _door_shuffle = false | 300 | _door_shuffle = false |
301 | _panel_door_shuffle = false | ||
286 | 302 | ||
287 | if _slot_data.has("shuffle_paintings"): | 303 | if _slot_data.has("shuffle_paintings"): |
288 | _painting_shuffle = _slot_data["shuffle_paintings"] | 304 | _painting_shuffle = _slot_data["shuffle_paintings"] |
@@ -762,6 +778,12 @@ func processItem(item, index, from, flags): | |||
762 | for door_id in gamedata.door_ids_by_item_id[int(item)]: | 778 | for door_id in gamedata.door_ids_by_item_id[int(item)]: |
763 | doorsNode.get_node(door_id).openDoor() | 779 | doorsNode.get_node(door_id).openDoor() |
764 | 780 | ||
781 | if gamedata.panel_ids_by_item_id.has(int(item)): | ||
782 | var panelsNode = get_tree().get_root().get_node("Spatial/Panels") | ||
783 | for panel_id in gamedata.panel_ids_by_item_id[int(item)]: | ||
784 | panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false | ||
785 | emit_signal("evaluate_solvability") | ||
786 | |||
765 | if gamedata.painting_ids_by_item_id.has(int(item)): | 787 | if gamedata.painting_ids_by_item_id.has(int(item)): |
766 | var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") | 788 | var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") |
767 | var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") | 789 | var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") |
@@ -782,15 +804,34 @@ func processItem(item, index, from, flags): | |||
782 | warpsNode.get_node(warp_id).unlock_warp() | 804 | warpsNode.get_node(warp_id).unlock_warp() |
783 | 805 | ||
784 | # Handle progressive items. | 806 | # Handle progressive items. |
785 | if int(item) in gamedata.items_by_progressive_id.keys(): | 807 | var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id |
808 | var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id | ||
809 | var progitems = null | ||
810 | var prognames = null | ||
811 | |||
812 | if is_progressive_door and is_progressive_panel: | ||
813 | if _door_shuffle: | ||
814 | progitems = gamedata.door_items_by_progressive_id[int(item)] | ||
815 | prognames = door_progressive_items | ||
816 | else: | ||
817 | progitems = gamedata.panel_items_by_progressive_id[int(item)] | ||
818 | prognames = panel_progressive_items | ||
819 | elif is_progressive_door: | ||
820 | progitems = gamedata.door_items_by_progressive_id[int(item)] | ||
821 | prognames = door_progressive_items | ||
822 | elif is_progressive_panel: | ||
823 | progitems = gamedata.panel_items_by_progressive_id[int(item)] | ||
824 | prognames = panel_progressive_items | ||
825 | |||
826 | if progitems != null: | ||
786 | if not int(item) in _progressive_progress: | 827 | if not int(item) in _progressive_progress: |
787 | _progressive_progress[int(item)] = 0 | 828 | _progressive_progress[int(item)] = 0 |
788 | 829 | ||
789 | if _progressive_progress[int(item)] < gamedata.items_by_progressive_id[int(item)].size(): | 830 | if _progressive_progress[int(item)] < progitems.size(): |
790 | var subitems = gamedata.items_by_progressive_id[int(item)] | 831 | var subitem_id = progitems[_progressive_progress[int(item)]] |
791 | var subitem_id = subitems[_progressive_progress[int(item)]] | ||
792 | global._print("Subitem: %d" % subitem_id) | 832 | global._print("Subitem: %d" % subitem_id) |
793 | processItem(subitem_id, null, null, null) | 833 | processItem(subitem_id, null, null, null) |
834 | item_name += " (%s)" % prognames[item_name][_progressive_progress[int(item)]] | ||
794 | _progressive_progress[int(item)] += 1 | 835 | _progressive_progress[int(item)] += 1 |
795 | 836 | ||
796 | if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]): | 837 | if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]): |
@@ -804,10 +845,6 @@ func processItem(item, index, from, flags): | |||
804 | _last_new_item = index | 845 | _last_new_item = index |
805 | saveLocaldata() | 846 | saveLocaldata() |
806 | 847 | ||
807 | if item_name in progressive_items: | ||
808 | var subitem = progressive_items[item_name][_progressive_progress[int(item)] - 1] | ||
809 | item_name += " (%s)" % subitem | ||
810 | |||
811 | var player_name = "Unknown" | 848 | var player_name = "Unknown" |
812 | if _player_name_by_slot.has(from): | 849 | if _player_name_by_slot.has(from): |
813 | player_name = _player_name_by_slot[from] | 850 | player_name = _player_name_by_slot[from] |