diff options
| -rw-r--r-- | Archipelago/client.gd | 26 | ||||
| -rw-r--r-- | Archipelago/settings_screen.gd | 1 | ||||
| -rw-r--r-- | Archipelago/teleport.gd | 24 | ||||
| -rw-r--r-- | util/generate_gamedata.rb | 24 |
4 files changed, 75 insertions, 0 deletions
| diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 3541016..db79e15 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
| @@ -62,6 +62,15 @@ const progressive_items = { | |||
| 62 | {"item": "The Colorful - Green Door", "display": "Green"}, | 62 | {"item": "The Colorful - Green Door", "display": "Green"}, |
| 63 | {"item": "The Colorful - Brown Door", "display": "Brown"}, | 63 | {"item": "The Colorful - Brown Door", "display": "Brown"}, |
| 64 | {"item": "The Colorful - Gray Door", "display": "Gray"}, | 64 | {"item": "The Colorful - Gray Door", "display": "Gray"}, |
| 65 | ], | ||
| 66 | "Progressive Pilgrimage": | ||
| 67 | [ | ||
| 68 | {"item": "Hub Room - 1 Sunwarp", "display": "1 Sunwarp"}, | ||
| 69 | {"item": "Orange Tower Fourth Floor - 2 Sunwarp", "display": "2 Sunwarp"}, | ||
| 70 | {"item": "Orange Tower Third Floor - 3 Sunwarp", "display": "3 Sunwarp"}, | ||
| 71 | {"item": "Orange Tower First Floor - 4 Sunwarp", "display": "4 Sunwarp"}, | ||
| 72 | {"item": "Orange Tower Fourth Floor - 5 Sunwarp", "display": "5 Sunwarp"}, | ||
| 73 | {"item": "Outside The Agreeable - 6 Sunwarp", "display": "6 Sunwarp"}, | ||
| 65 | ] | 74 | ] |
| 66 | } | 75 | } |
| 67 | 76 | ||
| @@ -80,6 +89,11 @@ const kCLASSIFICATION_REMOTE_NORMAL = 0 | |||
| 80 | const kCLASSIFICATION_REMOTE_REDUCED = 1 | 89 | const kCLASSIFICATION_REMOTE_REDUCED = 1 |
| 81 | const kCLASSIFICATION_REMOTE_INSANITY = 2 | 90 | const kCLASSIFICATION_REMOTE_INSANITY = 2 |
| 82 | 91 | ||
| 92 | const kSUNWARP_ACCESS_NORMAL = 0 | ||
| 93 | const kSUNWARP_ACCESS_DISABLED = 1 | ||
| 94 | const kSUNWARP_ACCESS_UNLOCK = 2 | ||
| 95 | const kSUNWARP_ACCESS_PROGRESSIVE = 3 | ||
| 96 | |||
| 83 | var _client = WebSocketClient.new() | 97 | var _client = WebSocketClient.new() |
| 84 | var _should_process = false | 98 | var _should_process = false |
| 85 | var _initiated_disconnect = false | 99 | var _initiated_disconnect = false |
| @@ -111,6 +125,7 @@ var _door_shuffle = false | |||
| 111 | var _color_shuffle = false | 125 | var _color_shuffle = false |
| 112 | var _panel_shuffle = 0 # none, rearrange | 126 | var _panel_shuffle = 0 # none, rearrange |
| 113 | var _painting_shuffle = false | 127 | var _painting_shuffle = false |
| 128 | var _sunwarp_access = 0 # normal, disabled, unlock, progressive | ||
| 114 | var _mastery_achievements = 21 | 129 | var _mastery_achievements = 21 |
| 115 | var _level_2_requirement = 223 | 130 | var _level_2_requirement = 223 |
| 116 | var _location_classification_bit = 0 | 131 | var _location_classification_bit = 0 |
| @@ -276,6 +291,8 @@ func _on_data(): | |||
| 276 | _painting_shuffle = _slot_data["shuffle_paintings"] | 291 | _painting_shuffle = _slot_data["shuffle_paintings"] |
| 277 | if _slot_data.has("shuffle_panels"): | 292 | if _slot_data.has("shuffle_panels"): |
| 278 | _panel_shuffle = _slot_data["shuffle_panels"] | 293 | _panel_shuffle = _slot_data["shuffle_panels"] |
| 294 | if _slot_data.has("sunwarp_access"): | ||
| 295 | _sunwarp_access = _slot_data["sunwarp_access"] | ||
| 279 | if _slot_data.has("seed"): | 296 | if _slot_data.has("seed"): |
| 280 | _slot_seed = _slot_data["seed"] | 297 | _slot_seed = _slot_data["seed"] |
| 281 | if _slot_data.has("painting_entrance_to_exit"): | 298 | if _slot_data.has("painting_entrance_to_exit"): |
| @@ -632,6 +649,11 @@ func processItem(item, index, from, flags): | |||
| 632 | painting_node = fake_parent_node.get_node_or_null(painting_id) | 649 | painting_node = fake_parent_node.get_node_or_null(painting_id) |
| 633 | if painting_node != null: | 650 | if painting_node != null: |
| 634 | painting_node.get_node("Script").movePainting() | 651 | painting_node.get_node("Script").movePainting() |
| 652 | |||
| 653 | if gamedata.warp_ids_by_item_id.has(int(item)): | ||
| 654 | var warpsNode = get_tree().get_root().get_node("Spatial/Warps") | ||
| 655 | for warp_id in gamedata.warp_ids_by_item_id[int(item)]: | ||
| 656 | warpsNode.get_node(warp_id).unlock_warp() | ||
| 635 | 657 | ||
| 636 | # Handle progressive items. | 658 | # Handle progressive items. |
| 637 | if item_name in progressive_items.keys(): | 659 | if item_name in progressive_items.keys(): |
| @@ -693,6 +715,10 @@ func paintingIsVanilla(painting): | |||
| 693 | return !$Gamedata.mentioned_paintings.has(painting) | 715 | return !$Gamedata.mentioned_paintings.has(painting) |
| 694 | 716 | ||
| 695 | 717 | ||
| 718 | func warpIsVanilla(warp): | ||
| 719 | return !$Gamedata.mentioned_warps.has(warp) | ||
| 720 | |||
| 721 | |||
| 696 | func evaluateSolvability(): | 722 | func evaluateSolvability(): |
| 697 | emit_signal("evaluate_solvability") | 723 | emit_signal("evaluate_solvability") |
| 698 | 724 | ||
| diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 2cabe09..0ae218e 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd | |||
| @@ -46,6 +46,7 @@ func _ready(): | |||
| 46 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd")) | 46 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd")) |
| 47 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd")) | 47 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd")) |
| 48 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd")) | 48 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd")) |
| 49 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/teleport.gd")) | ||
| 49 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd")) | 50 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd")) |
| 50 | 51 | ||
| 51 | var apclient = global.get_node("Archipelago") | 52 | var apclient = global.get_node("Archipelago") |
| diff --git a/Archipelago/teleport.gd b/Archipelago/teleport.gd new file mode 100644 index 0000000..d322722 --- /dev/null +++ b/Archipelago/teleport.gd | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | extends "res://scripts/teleport.gd" | ||
| 2 | |||
| 3 | var _unlocked = true | ||
| 4 | |||
| 5 | |||
| 6 | func _ready(): | ||
| 7 | var apclient = global.get_node("Archipelago") | ||
| 8 | if apclient._door_shuffle and !apclient.warpIsVanilla(self.get_parent().name + "/" + self.name): | ||
| 9 | if self.get_parent().name == "Teleporter Warps": | ||
| 10 | if apclient._sunwarp_access != apclient.kSUNWARP_ACCESS_NORMAL: | ||
| 11 | _unlocked = false | ||
| 12 | else: | ||
| 13 | _unlocked = false | ||
| 14 | |||
| 15 | ._ready() | ||
| 16 | |||
| 17 | |||
| 18 | func _body_entered(var body): | ||
| 19 | if _unlocked: | ||
| 20 | ._body_entered(body) | ||
| 21 | |||
| 22 | |||
| 23 | func unlock_warp(): | ||
| 24 | _unlocked = true | ||
| diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index 5e03655..1cce003 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb | |||
| @@ -15,10 +15,12 @@ door_groups = {} | |||
| 15 | panel_output = [] | 15 | panel_output = [] |
| 16 | door_ids_by_item_id = {} | 16 | door_ids_by_item_id = {} |
| 17 | painting_ids_by_item_id = {} | 17 | painting_ids_by_item_id = {} |
| 18 | warp_ids_by_item_id = {} | ||
| 18 | panel_ids_by_location_id = {} | 19 | panel_ids_by_location_id = {} |
| 19 | classification_by_location_id = {} | 20 | classification_by_location_id = {} |
| 20 | mentioned_doors = Set[] | 21 | mentioned_doors = Set[] |
| 21 | mentioned_paintings = Set[] | 22 | mentioned_paintings = Set[] |
| 23 | mentioned_warps = Set[] | ||
| 22 | painting_output = {} | 24 | painting_output = {} |
| 23 | 25 | ||
| 24 | ids_config = YAML.load_file(idspath) | 26 | ids_config = YAML.load_file(idspath) |
| @@ -152,6 +154,18 @@ config.each do |room_name, room_data| | |||
| 152 | painting_ids_by_item_id[item_id] = internal_painting_ids | 154 | painting_ids_by_item_id[item_id] = internal_painting_ids |
| 153 | mentioned_paintings.merge(internal_painting_ids) | 155 | mentioned_paintings.merge(internal_painting_ids) |
| 154 | end | 156 | end |
| 157 | |||
| 158 | if door.include? "warp_id" | ||
| 159 | internal_warp_ids = [] | ||
| 160 | if door["warp_id"].kind_of? String | ||
| 161 | internal_warp_ids = [door["warp_id"]] | ||
| 162 | else | ||
| 163 | internal_warp_ids = door["warp_id"] | ||
| 164 | end | ||
| 165 | |||
| 166 | warp_ids_by_item_id[item_id] = internal_warp_ids | ||
| 167 | mentioned_warps.merge(internal_warp_ids) | ||
| 168 | end | ||
| 155 | end | 169 | end |
| 156 | end | 170 | end |
| 157 | end | 171 | end |
| @@ -181,6 +195,12 @@ File.open(outputpath, "w") do |f| | |||
| 181 | "\"#{painting_id}\"" | 195 | "\"#{painting_id}\"" |
| 182 | end.join(",") + "]" | 196 | end.join(",") + "]" |
| 183 | end.join(",")) | 197 | end.join(",")) |
| 198 | f.write "}\nvar warp_ids_by_item_id = {" | ||
| 199 | f.write(warp_ids_by_item_id.map do |item_id, warp_ids| | ||
| 200 | "#{item_id}:[" + warp_ids.map do |warp_id| | ||
| 201 | "\"#{warp_id}\"" | ||
| 202 | end.join(",") + "]" | ||
| 203 | end.join(",")) | ||
| 184 | f.write "}\nvar panel_ids_by_location_id = {" | 204 | f.write "}\nvar panel_ids_by_location_id = {" |
| 185 | f.write(panel_ids_by_location_id.map do |location_id, panel_ids| | 205 | f.write(panel_ids_by_location_id.map do |location_id, panel_ids| |
| 186 | "#{location_id}:[" + panel_ids.map do |panel_id| | 206 | "#{location_id}:[" + panel_ids.map do |panel_id| |
| @@ -195,6 +215,10 @@ File.open(outputpath, "w") do |f| | |||
| 195 | f.write(mentioned_paintings.map do |painting_id| | 215 | f.write(mentioned_paintings.map do |painting_id| |
| 196 | "\"#{painting_id}\"" | 216 | "\"#{painting_id}\"" |
| 197 | end.join(",")) | 217 | end.join(",")) |
| 218 | f.write "]\nvar mentioned_warps = [" | ||
| 219 | f.write(mentioned_warps.map do |warp_id| | ||
| 220 | "\"#{warp_id}\"" | ||
| 221 | end.join(",")) | ||
| 198 | f.write "]\nvar paintings = {" | 222 | f.write "]\nvar paintings = {" |
| 199 | f.write(painting_output.map do |painting_id, painting| | 223 | f.write(painting_output.map do |painting_id, painting| |
| 200 | "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}" | 224 | "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}" |
