diff options
Diffstat (limited to 'Archipelago')
-rw-r--r-- | Archipelago/client.gd | 45 | ||||
-rw-r--r-- | Archipelago/effects.gd | 75 | ||||
-rw-r--r-- | Archipelago/load.gd | 23 | ||||
-rw-r--r-- | Archipelago/panel.gd | 2 | ||||
-rw-r--r-- | Archipelago/panelEnd.gd | 2 | ||||
-rw-r--r-- | Archipelago/panelLevelSwitch.gd | 2 |
6 files changed, 122 insertions, 27 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 788f6ca..58a099c 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -15,8 +15,8 @@ var ap_pass = "" | |||
15 | var confusify_world = false | 15 | var confusify_world = false |
16 | var enable_multiplayer = false | 16 | var enable_multiplayer = false |
17 | 17 | ||
18 | const my_version = "1.1.0" | 18 | const my_version = "2.0.0-beta2" |
19 | const ap_version = {"major": 0, "minor": 4, "build": 4, "class": "Version"} | 19 | const ap_version = {"major": 0, "minor": 4, "build": 5, "class": "Version"} |
20 | const color_items = [ | 20 | const color_items = [ |
21 | "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" | 21 | "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" |
22 | ] | 22 | ] |
@@ -49,6 +49,19 @@ const progressive_items = { | |||
49 | [ | 49 | [ |
50 | {"item": "The Fearless (First Floor) - Second Floor", "display": "Second Floor"}, | 50 | {"item": "The Fearless (First Floor) - Second Floor", "display": "Second Floor"}, |
51 | {"item": "The Fearless (Second Floor) - Third Floor", "display": "Third Floor"}, | 51 | {"item": "The Fearless (Second Floor) - Third Floor", "display": "Third Floor"}, |
52 | ], | ||
53 | "Progressive Colorful": | ||
54 | [ | ||
55 | {"item": "The Colorful - White Door", "display": "White"}, | ||
56 | {"item": "The Colorful - Black Door", "display": "Black"}, | ||
57 | {"item": "The Colorful - Red Door", "display": "Red"}, | ||
58 | {"item": "The Colorful - Yellow Door", "display": "Yellow"}, | ||
59 | {"item": "The Colorful - Blue Door", "display": "Blue"}, | ||
60 | {"item": "The Colorful - Purple Door", "display": "Purple"}, | ||
61 | {"item": "The Colorful - Orange Door", "display": "Orange"}, | ||
62 | {"item": "The Colorful - Green Door", "display": "Green"}, | ||
63 | {"item": "The Colorful - Brown Door", "display": "Brown"}, | ||
64 | {"item": "The Colorful - Gray Door", "display": "Gray"}, | ||
52 | ] | 65 | ] |
53 | } | 66 | } |
54 | 67 | ||
@@ -112,6 +125,9 @@ var _progressive_progress = {} | |||
112 | var _has_colors = ["white"] | 125 | var _has_colors = ["white"] |
113 | var _received_indexes = [] | 126 | var _received_indexes = [] |
114 | var _puzzle_skips = 0 | 127 | var _puzzle_skips = 0 |
128 | var _cached_slowness = 0 | ||
129 | var _cached_iceland = 0 | ||
130 | var _cached_atbash = 0 | ||
115 | 131 | ||
116 | signal could_not_connect | 132 | signal could_not_connect |
117 | signal connect_status | 133 | signal connect_status |
@@ -298,6 +314,21 @@ func _on_data(): | |||
298 | if localdata.size() > 1: | 314 | if localdata.size() > 1: |
299 | _puzzle_skips = localdata[1] | 315 | _puzzle_skips = localdata[1] |
300 | 316 | ||
317 | if localdata.size() > 2: | ||
318 | _cached_slowness = localdata[2] | ||
319 | else: | ||
320 | _cached_slowness = 0 | ||
321 | |||
322 | if localdata.size() > 3: | ||
323 | _cached_iceland = localdata[3] | ||
324 | else: | ||
325 | _cached_iceland = 0 | ||
326 | |||
327 | if localdata.size() > 4: | ||
328 | _cached_atbash = localdata[4] | ||
329 | else: | ||
330 | _cached_atbash = 0 | ||
331 | |||
301 | requestSync() | 332 | requestSync() |
302 | 333 | ||
303 | emit_signal("client_connected") | 334 | emit_signal("client_connected") |
@@ -450,7 +481,15 @@ func saveLocaldata(): | |||
450 | var file = File.new() | 481 | var file = File.new() |
451 | file.open(_localdata_file, File.WRITE) | 482 | file.open(_localdata_file, File.WRITE) |
452 | 483 | ||
453 | var data = [_last_new_item, _puzzle_skips] | 484 | var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects") |
485 | |||
486 | var data = [ | ||
487 | _last_new_item, | ||
488 | _puzzle_skips, | ||
489 | effects_node.slowness_remaining, | ||
490 | effects_node.iceland_remaining, | ||
491 | effects_node.atbash_remaining | ||
492 | ] | ||
454 | file.store_var(data, true) | 493 | file.store_var(data, true) |
455 | file.close() | 494 | file.close() |
456 | 495 | ||
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index e830fbc..1e2e311 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd | |||
@@ -4,7 +4,7 @@ var activated = false | |||
4 | var effect_running = false | 4 | var effect_running = false |
5 | var slowness_remaining = 0 | 5 | var slowness_remaining = 0 |
6 | var iceland_remaining = 0 | 6 | var iceland_remaining = 0 |
7 | var atbash_activated = false | 7 | var atbash_remaining = 0 |
8 | var queued_iceland = 0 | 8 | var queued_iceland = 0 |
9 | var skip_available = false | 9 | var skip_available = false |
10 | var puzzle_focused = false | 10 | var puzzle_focused = false |
@@ -58,13 +58,13 @@ func _ready(): | |||
58 | func activate(): | 58 | func activate(): |
59 | activated = true | 59 | activated = true |
60 | 60 | ||
61 | for _i in range(0, queued_iceland): | 61 | if queued_iceland > 0: |
62 | trigger_iceland_trap() | 62 | trigger_iceland_trap(queued_iceland) |
63 | 63 | ||
64 | queued_iceland = 0 | 64 | queued_iceland = 0 |
65 | 65 | ||
66 | 66 | ||
67 | func trigger_slowness_trap(): | 67 | func trigger_slowness_trap(length = 30): |
68 | if slowness_remaining == 0: | 68 | if slowness_remaining == 0: |
69 | var player = get_tree().get_root().get_node("Spatial/player") | 69 | var player = get_tree().get_root().get_node("Spatial/player") |
70 | player.walk_speed = orig_walk / 2.0 | 70 | player.walk_speed = orig_walk / 2.0 |
@@ -72,13 +72,16 @@ func trigger_slowness_trap(): | |||
72 | 72 | ||
73 | $SlownessTimer.start() | 73 | $SlownessTimer.start() |
74 | 74 | ||
75 | slowness_remaining += 30 | 75 | slowness_remaining += length |
76 | text_dirty = true | 76 | text_dirty = true |
77 | 77 | ||
78 | var apclient = global.get_node("Archipelago") | ||
79 | apclient.saveLocaldata() | ||
78 | 80 | ||
79 | func trigger_iceland_trap(): | 81 | |
82 | func trigger_iceland_trap(length = 60): | ||
80 | if not activated: | 83 | if not activated: |
81 | queued_iceland += 1 | 84 | queued_iceland += length |
82 | return | 85 | return |
83 | 86 | ||
84 | if iceland_remaining == 0: | 87 | if iceland_remaining == 0: |
@@ -88,31 +91,45 @@ func trigger_iceland_trap(): | |||
88 | 91 | ||
89 | $IcelandTimer.start() | 92 | $IcelandTimer.start() |
90 | 93 | ||
91 | iceland_remaining += 60 | 94 | iceland_remaining += length |
92 | text_dirty = true | 95 | text_dirty = true |
93 | 96 | ||
97 | var apclient = global.get_node("Archipelago") | ||
98 | apclient.saveLocaldata() | ||
99 | |||
94 | 100 | ||
95 | func trigger_atbash_trap(): | 101 | func trigger_atbash_trap(): |
96 | if not atbash_activated: | 102 | var newly_atbash = (atbash_remaining == 0) |
97 | atbash_activated = true | 103 | atbash_remaining += 1 |
98 | 104 | ||
105 | if newly_atbash: | ||
99 | var apclient = global.get_node("Archipelago") | 106 | var apclient = global.get_node("Archipelago") |
100 | apclient.evaluateSolvability() | 107 | apclient.evaluateSolvability() |
101 | 108 | ||
102 | text_dirty = true | 109 | text_dirty = true |
110 | |||
111 | var apclient = global.get_node("Archipelago") | ||
112 | apclient.saveLocaldata() | ||
103 | 113 | ||
104 | 114 | ||
105 | func deactivate_atbash_trap(): | 115 | func deactivate_atbash_trap(): |
106 | if atbash_activated: | 116 | if atbash_remaining > 0: |
107 | atbash_activated = false | 117 | atbash_remaining -= 1 |
108 | 118 | ||
109 | var apclient = global.get_node("Archipelago") | 119 | if atbash_remaining == 0: |
110 | apclient.evaluateSolvability() | 120 | var apclient = global.get_node("Archipelago") |
121 | apclient.evaluateSolvability() | ||
111 | 122 | ||
112 | text_dirty = true | 123 | text_dirty = true |
124 | |||
125 | var apclient = global.get_node("Archipelago") | ||
126 | apclient.saveLocaldata() | ||
113 | 127 | ||
114 | 128 | ||
115 | func show_puzzle_skip_message(node_path): | 129 | func show_puzzle_skip_message(node_path): |
130 | if puzzle_focused and node_path != puzzle_to_skip: | ||
131 | hide_puzzle_skip_message() | ||
132 | |||
116 | var panel_input = get_tree().get_root().get_node(node_path) | 133 | var panel_input = get_tree().get_root().get_node(node_path) |
117 | if not panel_input.visible: | 134 | if not panel_input.visible: |
118 | return | 135 | return |
@@ -126,6 +143,7 @@ func show_puzzle_skip_message(node_path): | |||
126 | puzzle_focused = true | 143 | puzzle_focused = true |
127 | wallcast.enabled = true | 144 | wallcast.enabled = true |
128 | not_behind_wall = false | 145 | not_behind_wall = false |
146 | text_dirty = true | ||
129 | puzzle_to_skip = node_path | 147 | puzzle_to_skip = node_path |
130 | _evaluate_puzzle_skip() | 148 | _evaluate_puzzle_skip() |
131 | 149 | ||
@@ -133,6 +151,8 @@ func show_puzzle_skip_message(node_path): | |||
133 | func hide_puzzle_skip_message(): | 151 | func hide_puzzle_skip_message(): |
134 | puzzle_focused = false | 152 | puzzle_focused = false |
135 | wallcast.enabled = false | 153 | wallcast.enabled = false |
154 | not_behind_wall = false | ||
155 | text_dirty = true | ||
136 | _evaluate_puzzle_skip() | 156 | _evaluate_puzzle_skip() |
137 | 157 | ||
138 | 158 | ||
@@ -172,6 +192,10 @@ func _tick_slowness(): | |||
172 | player.run_speed = orig_run | 192 | player.run_speed = orig_run |
173 | 193 | ||
174 | $SlownessTimer.stop() | 194 | $SlownessTimer.stop() |
195 | |||
196 | if slowness_remaining % 5 == 0: | ||
197 | var apclient = global.get_node("Archipelago") | ||
198 | apclient.saveLocaldata() | ||
175 | 199 | ||
176 | 200 | ||
177 | func _tick_iceland(): | 201 | func _tick_iceland(): |
@@ -184,22 +208,33 @@ func _tick_iceland(): | |||
184 | ) | 208 | ) |
185 | 209 | ||
186 | $IcelandTimer.stop() | 210 | $IcelandTimer.stop() |
211 | |||
212 | if iceland_remaining % 5 == 0: | ||
213 | var apclient = global.get_node("Archipelago") | ||
214 | apclient.saveLocaldata() | ||
187 | 215 | ||
188 | 216 | ||
189 | func _process(_delta): | 217 | func _process(_delta): |
190 | if puzzle_focused: | 218 | if puzzle_focused: |
219 | var should_nbw = false | ||
191 | if wallcast.is_colliding(): | 220 | if wallcast.is_colliding(): |
192 | var should_nbw = (get_tree().get_root().get_node("Spatial/player")._get_panel_from_ray(wallcast) != null) | 221 | var player = get_tree().get_root().get_node("Spatial/player") |
193 | if should_nbw != not_behind_wall: | 222 | var puzzlecast = player.get_node("pivot/camera/RayCast_sight") |
194 | not_behind_wall = true | 223 | var distance = puzzlecast.get_collision_point().distance_to(wallcast.get_collision_point()) |
195 | text_dirty = true | 224 | should_nbw = (distance < 0.05) |
225 | |||
226 | if should_nbw != not_behind_wall: | ||
227 | not_behind_wall = should_nbw | ||
228 | text_dirty = true | ||
196 | 229 | ||
197 | if text_dirty: | 230 | if text_dirty: |
198 | text_dirty = false | 231 | text_dirty = false |
199 | 232 | ||
200 | var text = "" | 233 | var text = "" |
201 | if atbash_activated: | 234 | if atbash_remaining == 1: |
202 | text += "Atbash Trap lasts until you solve a puzzle" | 235 | text += "Atbash Trap lasts until you solve a puzzle" |
236 | if atbash_remaining > 1: | ||
237 | text += ("Atbash Trap lasts until you solve %d puzzles" % atbash_remaining) | ||
203 | if slowness_remaining > 0: | 238 | if slowness_remaining > 0: |
204 | if not text.empty(): | 239 | if not text.empty(): |
205 | text += "\n" | 240 | text += "\n" |
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 7f86c91..59d2ac2 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -91,9 +91,21 @@ func _load(): | |||
91 | 91 | ||
92 | wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map | 92 | wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map |
93 | 93 | ||
94 | # Turn THE COLORFUL into a cdp. | ||
95 | var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") | ||
96 | var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") | ||
97 | var colorful_cdp = cdp_auto_scene.instance() | ||
98 | colorful_cdp.name = "CountdownPanel_colorful" | ||
99 | colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" | ||
100 | colorful_cdp.panels = "../../Panels/Doorways Room" | ||
101 | colorful_cdp.translation = real_colorful.translation | ||
102 | colorful_cdp.rotation = real_colorful.rotation | ||
103 | get_node("CountdownPanels").add_child(colorful_cdp) | ||
104 | real_colorful.translation = Vector3(-51, -35, 35) # way under the map | ||
105 | get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() | ||
106 | |||
94 | # Set up The Master to be variable. | 107 | # Set up The Master to be variable. |
95 | var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") | 108 | var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") |
96 | var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") | ||
97 | var new_master_cdp = cdp_auto_scene.instance() | 109 | var new_master_cdp = cdp_auto_scene.instance() |
98 | new_master_cdp.name = "AP_variable_master" | 110 | new_master_cdp.name = "AP_variable_master" |
99 | new_master_cdp.replace_with = old_master_cdp.replace_with | 111 | new_master_cdp.replace_with = old_master_cdp.replace_with |
@@ -565,6 +577,15 @@ func _load(): | |||
565 | global._print("Hooked Load End") | 577 | global._print("Hooked Load End") |
566 | ._load() | 578 | ._load() |
567 | 579 | ||
580 | # Activate any cached traps. | ||
581 | if apclient._cached_slowness > 0: | ||
582 | effects.trigger_slowness_trap(apclient._cached_slowness) | ||
583 | if apclient._cached_iceland > 0: | ||
584 | effects.trigger_iceland_trap(apclient._cached_iceland) | ||
585 | if apclient._cached_atbash > 0: | ||
586 | for _i in range(0, apclient._cached_atbash): | ||
587 | effects.trigger_atbash_trap() | ||
588 | |||
568 | # Process any items received while the map was loading, and send the checks | 589 | # Process any items received while the map was loading, and send the checks |
569 | # from the save load. | 590 | # from the save load. |
570 | apclient.mapFinishedLoading() | 591 | apclient.mapFinishedLoading() |
diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index da5b572..aec18e8 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd | |||
@@ -46,7 +46,7 @@ func evaluate_solvability(): | |||
46 | solvable = false | 46 | solvable = false |
47 | 47 | ||
48 | if solvable: | 48 | if solvable: |
49 | if effects.atbash_activated: | 49 | if effects.atbash_remaining > 0: |
50 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = atbash_text | 50 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = atbash_text |
51 | else: | 51 | else: |
52 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text | 52 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text |
diff --git a/Archipelago/panelEnd.gd b/Archipelago/panelEnd.gd index 81f07d6..136777d 100644 --- a/Archipelago/panelEnd.gd +++ b/Archipelago/panelEnd.gd | |||
@@ -4,4 +4,4 @@ extends "res://scripts/panelEnd.gd" | |||
4 | func handle_correct(): | 4 | func handle_correct(): |
5 | # We don't call the base method because we want to suppress the original | 5 | # We don't call the base method because we want to suppress the original |
6 | # behaviour. | 6 | # behaviour. |
7 | global.solved -= 1 | 7 | pass |
diff --git a/Archipelago/panelLevelSwitch.gd b/Archipelago/panelLevelSwitch.gd index 06df02b..8c369ef 100644 --- a/Archipelago/panelLevelSwitch.gd +++ b/Archipelago/panelLevelSwitch.gd | |||
@@ -4,4 +4,4 @@ extends "res://scripts/panelLevelSwitch.gd" | |||
4 | func handle_correct(): | 4 | func handle_correct(): |
5 | # We don't call the base method because we want to suppress the original | 5 | # We don't call the base method because we want to suppress the original |
6 | # behaviour. | 6 | # behaviour. |
7 | global.solved -= 1 | 7 | pass |