about summary refs log tree commit diff stats
path: root/Archipelago/client.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-04-18 14:11:17 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-04-18 14:11:17 -0400
commitc068e66ec9c085d0d897095e6248f70308046de1 (patch)
tree1acbd161bd5e8cdb6a9839b0314908bfd01cf06d /Archipelago/client.gd
parentc6770ac83c49f4adb7e2c2a6ee6290f0487a3873 (diff)
downloadlingo-archipelago-c068e66ec9c085d0d897095e6248f70308046de1.tar.gz
lingo-archipelago-c068e66ec9c085d0d897095e6248f70308046de1.tar.bz2
lingo-archipelago-c068e66ec9c085d0d897095e6248f70308046de1.zip
Added painting shuffling
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r--Archipelago/client.gd22
1 files changed, 20 insertions, 2 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index c5f1488..79313b2 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -42,12 +42,15 @@ var _mentioned_doors = []
42var _painting_ids_by_item = {} 42var _painting_ids_by_item = {}
43var _mentioned_paintings = [] 43var _mentioned_paintings = []
44var _panel_ids_by_location = {} 44var _panel_ids_by_location = {}
45var _paintings = {}
46var _paintings_mapping = {}
45var _localdata_file = "" 47var _localdata_file = ""
46var _death_link = false 48var _death_link = false
47var _victory_condition = 0 # THE END, THE MASTER 49var _victory_condition = 0 # THE END, THE MASTER
48var _door_shuffle = false 50var _door_shuffle = false
49var _color_shuffle = false 51var _color_shuffle = false
50var _panel_shuffle = 0 # none, rearrange 52var _panel_shuffle = 0 # none, rearrange
53var _painting_shuffle = false
51var _slot_seed = 0 54var _slot_seed = 0
52 55
53var _map_loaded = false 56var _map_loaded = false
@@ -162,6 +165,8 @@ func _on_data():
162 _mentioned_paintings.append(painting) 165 _mentioned_paintings.append(painting)
163 if _slot_data.has("panel_ids_by_location_id"): 166 if _slot_data.has("panel_ids_by_location_id"):
164 _panel_ids_by_location = _slot_data["panel_ids_by_location_id"] 167 _panel_ids_by_location = _slot_data["panel_ids_by_location_id"]
168 if _slot_data.has("paintings"):
169 _paintings = _slot_data["paintings"]
165 170
166 _death_link = _slot_data.has("death_link") and _slot_data["death_link"] 171 _death_link = _slot_data.has("death_link") and _slot_data["death_link"]
167 if _death_link: 172 if _death_link:
@@ -173,10 +178,14 @@ func _on_data():
173 _color_shuffle = _slot_data["shuffle_colors"] 178 _color_shuffle = _slot_data["shuffle_colors"]
174 if _slot_data.has("shuffle_doors"): 179 if _slot_data.has("shuffle_doors"):
175 _door_shuffle = (_slot_data["shuffle_doors"] > 0) 180 _door_shuffle = (_slot_data["shuffle_doors"] > 0)
181 if _slot_data.has("shuffle_paintings"):
182 _painting_shuffle = (_slot_data["shuffle_paintings"] > 0)
176 if _slot_data.has("shuffle_panels"): 183 if _slot_data.has("shuffle_panels"):
177 _panel_shuffle = _slot_data["shuffle_panels"] 184 _panel_shuffle = _slot_data["shuffle_panels"]
178 if _slot_data.has("seed"): 185 if _slot_data.has("seed"):
179 _slot_seed = _slot_data["seed"] 186 _slot_seed = _slot_data["seed"]
187 if _slot_data.has("painting_entrance_to_exit"):
188 _paintings_mapping = _slot_data["painting_entrance_to_exit"]
180 189
181 _localdata_file = "user://archipelago/%s_%d" % [_seed, _slot] 190 _localdata_file = "user://archipelago/%s_%d" % [_seed, _slot]
182 var ap_file = File.new() 191 var ap_file = File.new()
@@ -411,9 +420,18 @@ func processItem(item, index, from):
411 doorsNode.get_node(door_id).openDoor() 420 doorsNode.get_node(door_id).openDoor()
412 421
413 if _painting_ids_by_item.has(stringified): 422 if _painting_ids_by_item.has(stringified):
414 var paintingsNode = get_tree().get_root().get_node("Spatial/Decorations/Paintings") 423 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings")
424 var fake_parent_node = get_tree().get_root().get_node("Spatial/AP_Paintings")
425
415 for painting_id in _painting_ids_by_item[stringified]: 426 for painting_id in _painting_ids_by_item[stringified]:
416 paintingsNode.get_node(painting_id).movePainting() 427 var painting_node = real_parent_node.get_node_or_null(painting_id)
428 if painting_node != null:
429 painting_node.movePainting()
430
431 if _painting_shuffle:
432 painting_node = fake_parent_node.get_node_or_null(painting_id)
433 if painting_node != null:
434 painting_node.get_node("Script").movePainting()
417 435
418 # Handle progressively opening up the tower. 436 # Handle progressively opening up the tower.
419 if _item_name_to_id["Progressive Orange Tower"] == item and _tower_floors < orange_tower.size(): 437 if _item_name_to_id["Progressive Orange Tower"] == item and _tower_floors < orange_tower.size():