diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-06-16 19:05:58 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-06-16 19:05:58 -0400 |
commit | e2936fdd05a7178772a47f5e7923a75c1b04a357 (patch) | |
tree | 5ea9455dd62634144784787ff5a76f14f3302112 /Archipelago/panel.gd | |
parent | 38b8f3dbb70472e99e90c5b1c5095c2c4f206880 (diff) | |
download | lingo-archipelago-e2936fdd05a7178772a47f5e7923a75c1b04a357.tar.gz lingo-archipelago-e2936fdd05a7178772a47f5e7923a75c1b04a357.tar.bz2 lingo-archipelago-e2936fdd05a7178772a47f5e7923a75c1b04a357.zip |
Atbash trap
Diffstat (limited to 'Archipelago/panel.gd')
-rw-r--r-- | Archipelago/panel.gd | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index 6ec5e14..bf43653 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd | |||
@@ -2,16 +2,29 @@ extends Node | |||
2 | 2 | ||
3 | var data = {} | 3 | var data = {} |
4 | var orig_text = "" | 4 | var orig_text = "" |
5 | var atbash_text = "" | ||
5 | var orig_color = Color(0, 0, 0, 0) | 6 | var orig_color = Color(0, 0, 0, 0) |
6 | 7 | ||
8 | const kAtbashPre = "abcdefghijklmnopqrstuvwxyz1234567890+-" | ||
9 | const kAtbashPost = "zyxwvutsrqponmlkjihgfedcba0987654321-+" | ||
10 | |||
7 | 11 | ||
8 | func _ready(): | 12 | func _ready(): |
9 | orig_text = self.get_parent().get_node("Viewport/GUI/Panel/Label").text | 13 | orig_text = self.get_parent().get_node("Viewport/GUI/Panel/Label").text |
10 | orig_color = self.get_parent().get_node("Quad").get_surface_material(0).albedo_color | 14 | orig_color = self.get_parent().get_node("Quad").get_surface_material(0).albedo_color |
11 | 15 | ||
16 | for i in range(0, orig_text.length()): | ||
17 | var old_char = orig_text[i] | ||
18 | if old_char in kAtbashPre: | ||
19 | var j = kAtbashPre.find(old_char) | ||
20 | atbash_text += kAtbashPost[j] | ||
21 | else: | ||
22 | atbash_text += old_char | ||
23 | |||
12 | 24 | ||
13 | func evaluate_solvability(): | 25 | func evaluate_solvability(): |
14 | var apclient = global.get_node("Archipelago") | 26 | var apclient = global.get_node("Archipelago") |
27 | var effects = get_tree().get_root().get_node("Spatial/AP_Effects") | ||
15 | 28 | ||
16 | var solvable = true | 29 | var solvable = true |
17 | var missing = [] | 30 | var missing = [] |
@@ -23,7 +36,10 @@ func evaluate_solvability(): | |||
23 | solvable = false | 36 | solvable = false |
24 | 37 | ||
25 | if solvable: | 38 | if solvable: |
26 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text | 39 | if effects.atbash_remaining > 0: |
40 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = atbash_text | ||
41 | else: | ||
42 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text | ||
27 | self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").editable = true | 43 | self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").editable = true |
28 | self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = orig_color | 44 | self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = orig_color |
29 | else: | 45 | else: |
@@ -37,3 +53,5 @@ func evaluate_solvability(): | |||
37 | self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = Color( | 53 | self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = Color( |
38 | 0.7, 0.2, 0.2 | 54 | 0.7, 0.2, 0.2 |
39 | ) | 55 | ) |
56 | |||
57 | self.get_parent().get_node("Viewport").render_target_update_mode = 1 | ||