about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Archipelago/client.gd16
-rw-r--r--Archipelago/load.gd1
-rw-r--r--Archipelago/location.gd4
-rw-r--r--util/generate_gamedata.rb27
4 files changed, 46 insertions, 2 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index ad37ef0..17c6063 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -48,6 +48,14 @@ const kLEVEL_2 = 2
48const kNO_PANEL_SHUFFLE = 0 48const kNO_PANEL_SHUFFLE = 0
49const kREARRANGE_PANELS = 1 49const kREARRANGE_PANELS = 1
50 50
51const kCLASSIFICATION_LOCAL_NORMAL = 1
52const kCLASSIFICATION_LOCAL_REDUCED = 2
53const kCLASSIFICATION_LOCAL_INSANITY = 4
54
55const kCLASSIFICATION_REMOTE_NORMAL = 0
56const kCLASSIFICATION_REMOTE_REDUCED = 1
57const kCLASSIFICATION_REMOTE_INSANITY = 2
58
51var _client = WebSocketClient.new() 59var _client = WebSocketClient.new()
52var _should_process = false 60var _should_process = false
53var _initiated_disconnect = false 61var _initiated_disconnect = false
@@ -83,6 +91,7 @@ var _panel_shuffle = 0 # none, rearrange
83var _painting_shuffle = false 91var _painting_shuffle = false
84var _mastery_achievements = 21 92var _mastery_achievements = 21
85var _level_2_requirement = 223 93var _level_2_requirement = 223
94var _location_classification_bit = 0
86var _slot_seed = 0 95var _slot_seed = 0
87 96
88var _map_loaded = false 97var _map_loaded = false
@@ -248,6 +257,13 @@ func _on_data():
248 _mastery_achievements = _slot_data["mastery_achievements"] 257 _mastery_achievements = _slot_data["mastery_achievements"]
249 if _slot_data.has("level_2_requirement"): 258 if _slot_data.has("level_2_requirement"):
250 _level_2_requirement = _slot_data["level_2_requirement"] 259 _level_2_requirement = _slot_data["level_2_requirement"]
260 if _slot_data.has("location_checks"):
261 if _slot_data["location_checks"] == kCLASSIFICATION_REMOTE_NORMAL:
262 _location_classification_bit = kCLASSIFICATION_LOCAL_NORMAL
263 elif _slot_data["location_checks"] == kCLASSIFICATION_REMOTE_REDUCED:
264 _location_classification_bit = kCLASSIFICATION_LOCAL_REDUCED
265 elif _slot_data["location_checks"] == kCLASSIFICATION_REMOTE_INSANITY:
266 _location_classification_bit = kCLASSIFICATION_LOCAL_INSANITY
251 267
252 _puzzle_skips = 0 268 _puzzle_skips = 0
253 269
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 33a5846..876910b 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd
@@ -118,6 +118,7 @@ func _load():
118 var location = location_script.new() 118 var location = location_script.new()
119 location.ap_id = int(apclient._location_name_to_id[location_id]) 119 location.ap_id = int(apclient._location_name_to_id[location_id])
120 location.name = "AP_location_%d" % location.ap_id 120 location.name = "AP_location_%d" % location.ap_id
121 location.classification = gamedata.classification_by_location_id[location_id]
121 self.add_child(location) 122 self.add_child(location)
122 123
123 var panels = gamedata.panel_ids_by_location_id[location_id] 124 var panels = gamedata.panel_ids_by_location_id[location_id]
diff --git a/Archipelago/location.gd b/Archipelago/location.gd index b85b5c4..7e76427 100644 --- a/Archipelago/location.gd +++ b/Archipelago/location.gd
@@ -4,6 +4,7 @@ var ap_name = ""
4var ap_id = 0 4var ap_id = 0
5var total = 0 5var total = 0
6var solved = 0 6var solved = 0
7var classification = 0
7var ran = false 8var ran = false
8 9
9 10
@@ -14,4 +15,5 @@ func handle_correct():
14 ran = true 15 ran = true
15 16
16 var apclient = global.get_node("Archipelago") 17 var apclient = global.get_node("Archipelago")
17 apclient.sendLocation(ap_id) 18 if classification & apclient._location_classification_bit:
19 apclient.sendLocation(ap_id)
diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index bf8e3ae..72f0932 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb
@@ -4,6 +4,10 @@ require 'yaml'
4configpath = ARGV[0] 4configpath = ARGV[0]
5outputpath = ARGV[1] 5outputpath = ARGV[1]
6 6
7CLASSIFICATION_NORMAL = 1
8CLASSIFICATION_REDUCED = 2
9CLASSIFICATION_INSANITY = 4
10
7panel_to_id = {} 11panel_to_id = {}
8door_groups = {} 12door_groups = {}
9 13
@@ -11,6 +15,7 @@ panel_output = []
11door_ids_by_item_id = {} 15door_ids_by_item_id = {}
12painting_ids_by_item_id = {} 16painting_ids_by_item_id = {}
13panel_ids_by_location_id = {} 17panel_ids_by_location_id = {}
18classification_by_location_id = {}
14mentioned_doors = Set[] 19mentioned_doors = Set[]
15mentioned_paintings = Set[] 20mentioned_paintings = Set[]
16painting_output = {} 21painting_output = {}
@@ -54,8 +59,17 @@ config.each do |room_name, room_data|
54 end 59 end
55 panel_output << ret 60 panel_output << ret
56 61
62 panel_ids_by_location_id[full_name] = [panel["id"]]
63
64 classification_by_location_id[full_name] ||= 0
65 classification_by_location_id[full_name] += CLASSIFICATION_INSANITY
66
57 if panel.include? "check" and panel["check"] 67 if panel.include? "check" and panel["check"]
58 panel_ids_by_location_id[full_name] = [panel["id"]] 68 classification_by_location_id[full_name] += CLASSIFICATION_NORMAL
69
70 unless panel.include? "exclude_reduce" and panel["exclude_reduce"]
71 classification_by_location_id[full_name] += CLASSIFICATION_REDUCED
72 end
59 end 73 end
60 end 74 end
61 end 75 end
@@ -105,6 +119,13 @@ config.each do |room_name, room_data|
105 end 119 end
106 panel_to_id[other_name] 120 panel_to_id[other_name]
107 end 121 end
122
123 classification_by_location_id[chosen_name] ||= 0
124 classification_by_location_id[chosen_name] += CLASSIFICATION_NORMAL
125
126 if door.include? "include_reduce" and door["include_reduce"]
127 classification_by_location_id[chosen_name] += CLASSIFICATION_REDUCED
128 end
108 end 129 end
109 130
110 if not (door.include? "skip_item" and door["skip_item"]) and 131 if not (door.include? "skip_item" and door["skip_item"]) and
@@ -189,5 +210,9 @@ File.open(outputpath, "w") do |f|
189 f.write(painting_output.map do |painting_id, painting| 210 f.write(painting_output.map do |painting_id, painting|
190 "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}" 211 "\"#{painting_id}\":{\"orientation\":\"#{painting["orientation"]}\",\"move\":#{painting.include? "move" and painting["move"]}}"
191 end.join(",")) 212 end.join(","))
213 f.write "}\nvar classification_by_location_id = {"
214 f.write(classification_by_location_id.map do |location_id, classification|
215 "\"#{location_id}\":#{classification}"
216 end.join(","))
192 f.write "}" 217 f.write "}"
193end 218end